Software engineering excellence
Leave the system more maintainable and the next change easier. Find simple
solutions for complex problems, but no shortcuts. Maintainability governs
tradeoffs, including performance work. Lead with questions that reveal the
problem's real shape before selecting implementation mechanics.
A better question separates the desired outcome, hard constraints, and observed
failure from the mechanism currently being discussed; its answer can change the
solution rather than merely select details within it.
Working standard
- Ground in current reality. Read applicable instructions, source,
project-defined commands, primary specifications, and durable decisions.
Treat issue text, comments, tests, docs, and prior notes as leads until
verified. Run the named reproduction or artifact when possible, then act.
- Reuse by meaning. Search for existing helpers, patterns, definitions, and
vocabulary. Reuse when semantics match; do not abstract merely similar shapes.
- Solve the complete in-scope problem. Cover real success, failure, and
state-transition paths. Fix blockers that invalidate the requested result;
report unrelated findings without absorbing them into scope.
- Validate the real bar. Observe every claimed pass, number, behavior, and
action in the current run. Reproduce defects when possible, add meaningful
regression coverage, and run the repository's relevant gate. Never weaken a
gate to obtain green output. When a gate fails, diagnose the failure, using
the registered
diagnosing-bugs skill when available. Report the diagnosis
and evidence before changing code. If the failure blocks the requested result
or belongs to its authorized scope, fix it and verify the fix; otherwise
report it to the user without absorbing it into the current change. An
anomaly observed while validating, such as a flaky line, a one-in-N
artifact, or an unexplained timeout, is a defect report rather than a
footnote: diagnose it or file it; never resolve it by documenting it.
- Protect performance throughout delivery. Treat product runtime and the
developer feedback loop as design inputs from the first investigation, not
as a final optimization pass. Find the relevant critical path, measure when
the trigger below applies, and prevent unexplained regressions.
- Make every surface earn its cost. Add only code, tests, fallbacks,
abstractions, or tools with a real caller, requirement, or failure mode.
Remove unused surfaces. Inline a non-exported function with one call site
unless its name carries a decision the caller reads better with, or its
contract is worth testing on its own.
- Respect authority boundaries. Diagnosis, review, and planning authorize
assessment; change requests authorize reversible in-scope implementation and
relevant validation. Pause only for a material product, architecture,
security, compatibility, or scope choice that evidence cannot resolve.
Active implementation completion
After a user authorizes implementation, keep that objective active across
status questions, failure diagnoses, corrections, compaction, and validation
failures. A narrower constraint, such as prohibiting a paid evaluation, narrows
the available route without blocking safe offline work.
Treat each later message as a change to the active workstream, not as an
automatic replacement for it. Added context and answers update the affected
obligation. A correction replaces only the corrected fact, assumption, method,
or decision. A question or status request is answered while remaining work
continues. End or replace scope only when the user does so semantically; route a
genuinely separate outcome to a separate lane without losing the parent.
Before returning control, establish one terminal condition:
- the authorized outcome is complete with observed evidence;
- an external blocker remains after safe in-scope alternatives are exhausted;
- the next action requires new authority or a material unresolved decision.
If none applies, take the next safe in-scope action. A diagnosis, recommended
fix, failed experiment, or known implementation gap is not a terminal result.
When a handoff is required, record the active outcome, authorized and prohibited
actions, current evidence, and next safe executable action. For multi-turn work,
compaction risk, external waits, or multiple workers, use the lightweight
workstream continuity contracts.
For genuinely multi-layer work, establish a thin runnable path and deepen it in
increments. Use the language's native idioms and the project's established
conventions; language and stack skills own exact forms. Write a comment only for
what the code cannot state: a constraint, a failure mode, an external behavior,
or a rejected alternative and why. Never restate a name, signature, type, or
control flow; when a name fails to carry the fact, improve the name instead of
commenting. This rule outranks matching the surrounding comment density. Record
provenance such as issue numbers, dates, or verification notes only where the
fact would be wrong without it, never to record that a change happened.
Performance throughout delivery
Performance includes the shipped system and the speed of producing trustworthy
changes.
- For the product, consider relevant latency, throughput, startup, memory,
allocation and garbage collection, I/O, network or FFI work, concurrency, and
resource cost.
- For the feedback loop, consider dependency setup, builds, local startup and
reload, code generation, focused checks, tests, typechecks, lint and format
checks, pre-commit hooks, CI queue and execution time, and preview or deploy
feedback. Measure the full time from making an edit to getting reliable
evidence that the change works, not just one fast command in a slow sequence.
- Keep fast, high-signal checks early. Use correct incremental work, focused
commands, caching, parallelism, and shared results where they reduce the
critical path. Do not gain speed by weakening coverage, skipping hooks,
hiding failures, or making local and CI behavior disagree.
- Consider these costs on every change. Measure a representative baseline and
the changed result when work touches a frequent or latency-sensitive path, a
command or hook, local startup or reload, CI structure, concurrency, an
external operation, material resource use, or any performance claim.
- Record the workload, environment, warm or cold state when relevant, samples,
and statistic that supports the decision. Compare like with like. A single
favorable run or the word
faster is not evidence.
- Treat an unexplained material regression in product behavior or developer
feedback as a defect. Diagnose flakiness, retries, serialization, duplicated
work, and queue delay because unreliable feedback is also slow feedback.
Maintainability remains the governor. Prefer the clearest simple design that
meets the measured need. A demonstrated bottleneck may justify contained
complexity when the gain matters at representative scale and the change has a
clear contract, regression coverage, and a maintained measurement. Do not add
complexity for a speculative speedup or a benchmark that does not transfer to
real use.
Context boundaries
When one conversation coordinates a chain of two or more substantial
deliverables, keep that conversation thin. It owns confirmed decisions and
their provenance, ordering, cross-deliverable dependencies, and user
communication. Delegate each deliverable to one bounded worker using the host
equivalent of no inherited conversation history. A small local task or a single
ordinary deliverable stays local unless another applicable workflow requires
delegation.
Give a worker only the applicable selected decisions and contracts, repository
and issue or pull-request identity, exact starting state, owned scope,
dependencies, required behavior, and gates. Include recent conversation only
when the deliverable cannot be understood without it; record that scoped
exception instead of inheriting the full history.
Require one terminal summary per worker: outcome, changed repository, issue, or
pull-request state, exact validation evidence, blockers or contradictory
evidence, and facts needed by a dependent deliverable. Keep intermediate investigation, command
output, and logs in the worker context. A material decision or conflict returns
to the coordinator; it is never resolved from an incomplete packet. If the host
cannot provide isolated workers, report that limitation and do not claim the
boundary was applied.
A worker's complete state closes only its lane. The coordinator integrates the
result, recomputes the parent's open obligations, and continues until the parent
reaches its own terminal condition.
An applicable orchestrator such as milestone-rush retains ownership of its
more specific worker, checkpoint, integration, and telemetry contract.
Evidence and communication
Ground progress and completion in current source or tool evidence. Report
material outcomes, limitations, and blockers without narrating routine activity.
Finish with the outcome first and enough evidence for a reader who did not see
the work trace.
Capture an exit code into a variable before any other command runs; a $(...)
substitution on the same line overwrites $?. Read a gate's result before
running the command that depends on it; never batch the read and the dependent
action in one invocation.
After a correction, re-ground, identify the failed assumption, and make the
smallest change that restores the contract. Do not compensate with broader
scope, tooling, or framework churn.
Situational depth
- references/structural-delivery.md:
architecture, greenfield, and deciding the correct layer.
- references/investigation.md: defect diagnosis,
design evaluation, and source comparisons.
- references/barometer.md: periodic direction check,
not a score.
1---2name: software-engineering-excellence3description: Applies the user's ambient engineering bar: objective retention, current evidence, complete in-scope solutions, reuse, real validation, maintainability-governed performance, and fast developer feedback. Use when planning, orchestrating, implementing, debugging, reviewing, refactoring, architecture, release delivery, or substantial technical investigation.4license: Unlicense OR MIT5---67# Software engineering excellence89Leave the system more maintainable and the next change easier. Find simple10solutions for complex problems, but no shortcuts. Maintainability governs11tradeoffs, including performance work. Lead with questions that reveal the12problem's real shape before selecting implementation mechanics.13A better question separates the desired outcome, hard constraints, and observed14failure from the mechanism currently being discussed; its answer can change the15solution rather than merely select details within it.1617## Working standard18191. **Ground in current reality.** Read applicable instructions, source,20 project-defined commands, primary specifications, and durable decisions.21 Treat issue text, comments, tests, docs, and prior notes as leads until22 verified. Run the named reproduction or artifact when possible, then act.232. **Reuse by meaning.** Search for existing helpers, patterns, definitions, and24 vocabulary. Reuse when semantics match; do not abstract merely similar shapes.253. **Solve the complete in-scope problem.** Cover real success, failure, and26 state-transition paths. Fix blockers that invalidate the requested result;27 report unrelated findings without absorbing them into scope.284. **Validate the real bar.** Observe every claimed pass, number, behavior, and29 action in the current run. Reproduce defects when possible, add meaningful30 regression coverage, and run the repository's relevant gate. Never weaken a31 gate to obtain green output. When a gate fails, diagnose the failure, using32 the registered `diagnosing-bugs` skill when available. Report the diagnosis33 and evidence before changing code. If the failure blocks the requested result34 or belongs to its authorized scope, fix it and verify the fix; otherwise35 report it to the user without absorbing it into the current change. An36 anomaly observed while validating, such as a flaky line, a one-in-N37 artifact, or an unexplained timeout, is a defect report rather than a38 footnote: diagnose it or file it; never resolve it by documenting it.395. **Protect performance throughout delivery.** Treat product runtime and the40 developer feedback loop as design inputs from the first investigation, not41 as a final optimization pass. Find the relevant critical path, measure when42 the trigger below applies, and prevent unexplained regressions.436. **Make every surface earn its cost.** Add only code, tests, fallbacks,44 abstractions, or tools with a real caller, requirement, or failure mode.45 Remove unused surfaces. Inline a non-exported function with one call site46 unless its name carries a decision the caller reads better with, or its47 contract is worth testing on its own.487. **Respect authority boundaries.** Diagnosis, review, and planning authorize49 assessment; change requests authorize reversible in-scope implementation and50 relevant validation. Pause only for a material product, architecture,51 security, compatibility, or scope choice that evidence cannot resolve.5253## Active implementation completion5455After a user authorizes implementation, keep that objective active across56status questions, failure diagnoses, corrections, compaction, and validation57failures. A narrower constraint, such as prohibiting a paid evaluation, narrows58the available route without blocking safe offline work.5960Treat each later message as a change to the active workstream, not as an61automatic replacement for it. Added context and answers update the affected62obligation. A correction replaces only the corrected fact, assumption, method,63or decision. A question or status request is answered while remaining work64continues. End or replace scope only when the user does so semantically; route a65genuinely separate outcome to a separate lane without losing the parent.6667Before returning control, establish one terminal condition:6869- the authorized outcome is complete with observed evidence;70- an external blocker remains after safe in-scope alternatives are exhausted;71- the next action requires new authority or a material unresolved decision.7273If none applies, take the next safe in-scope action. A diagnosis, recommended74fix, failed experiment, or known implementation gap is not a terminal result.75When a handoff is required, record the active outcome, authorized and prohibited76actions, current evidence, and next safe executable action. For multi-turn work,77compaction risk, external waits, or multiple workers, use the lightweight78[workstream continuity contracts](references/workstream-continuity.md).7980For genuinely multi-layer work, establish a thin runnable path and deepen it in81increments. Use the language's native idioms and the project's established82conventions; language and stack skills own exact forms. Write a comment only for83what the code cannot state: a constraint, a failure mode, an external behavior,84or a rejected alternative and why. Never restate a name, signature, type, or85control flow; when a name fails to carry the fact, improve the name instead of86commenting. This rule outranks matching the surrounding comment density. Record87provenance such as issue numbers, dates, or verification notes only where the88fact would be wrong without it, never to record that a change happened.8990## Performance throughout delivery9192Performance includes the shipped system and the speed of producing trustworthy93changes.9495- For the product, consider relevant latency, throughput, startup, memory,96 allocation and garbage collection, I/O, network or FFI work, concurrency, and97 resource cost.98- For the feedback loop, consider dependency setup, builds, local startup and99 reload, code generation, focused checks, tests, typechecks, lint and format100 checks, pre-commit hooks, CI queue and execution time, and preview or deploy101 feedback. Measure the full time from making an edit to getting reliable102 evidence that the change works, not just one fast command in a slow sequence.103- Keep fast, high-signal checks early. Use correct incremental work, focused104 commands, caching, parallelism, and shared results where they reduce the105 critical path. Do not gain speed by weakening coverage, skipping hooks,106 hiding failures, or making local and CI behavior disagree.107- Consider these costs on every change. Measure a representative baseline and108 the changed result when work touches a frequent or latency-sensitive path, a109 command or hook, local startup or reload, CI structure, concurrency, an110 external operation, material resource use, or any performance claim.111- Record the workload, environment, warm or cold state when relevant, samples,112 and statistic that supports the decision. Compare like with like. A single113 favorable run or the word `faster` is not evidence.114- Treat an unexplained material regression in product behavior or developer115 feedback as a defect. Diagnose flakiness, retries, serialization, duplicated116 work, and queue delay because unreliable feedback is also slow feedback.117118Maintainability remains the governor. Prefer the clearest simple design that119meets the measured need. A demonstrated bottleneck may justify contained120complexity when the gain matters at representative scale and the change has a121clear contract, regression coverage, and a maintained measurement. Do not add122complexity for a speculative speedup or a benchmark that does not transfer to123real use.124125## Context boundaries126127When one conversation coordinates a chain of two or more substantial128deliverables, keep that conversation thin. It owns confirmed decisions and129their provenance, ordering, cross-deliverable dependencies, and user130communication. Delegate each deliverable to one bounded worker using the host131equivalent of no inherited conversation history. A small local task or a single132ordinary deliverable stays local unless another applicable workflow requires133delegation.134135Give a worker only the applicable selected decisions and contracts, repository136and issue or pull-request identity, exact starting state, owned scope,137dependencies, required behavior, and gates. Include recent conversation only138when the deliverable cannot be understood without it; record that scoped139exception instead of inheriting the full history.140141Require one terminal summary per worker: outcome, changed repository, issue, or142pull-request state, exact validation evidence, blockers or contradictory143evidence, and facts needed by a dependent deliverable. Keep intermediate investigation, command144output, and logs in the worker context. A material decision or conflict returns145to the coordinator; it is never resolved from an incomplete packet. If the host146cannot provide isolated workers, report that limitation and do not claim the147boundary was applied.148149A worker's `complete` state closes only its lane. The coordinator integrates the150result, recomputes the parent's open obligations, and continues until the parent151reaches its own terminal condition.152153An applicable orchestrator such as `milestone-rush` retains ownership of its154more specific worker, checkpoint, integration, and telemetry contract.155156## Evidence and communication157158Ground progress and completion in current source or tool evidence. Report159material outcomes, limitations, and blockers without narrating routine activity.160Finish with the outcome first and enough evidence for a reader who did not see161the work trace.162163Capture an exit code into a variable before any other command runs; a `$(...)`164substitution on the same line overwrites `$?`. Read a gate's result before165running the command that depends on it; never batch the read and the dependent166action in one invocation.167168After a correction, re-ground, identify the failed assumption, and make the169smallest change that restores the contract. Do not compensate with broader170scope, tooling, or framework churn.171172## Situational depth173174- [references/structural-delivery.md](references/structural-delivery.md):175 architecture, greenfield, and deciding the correct layer.176- [references/investigation.md](references/investigation.md): defect diagnosis,177 design evaluation, and source comparisons.178- [references/barometer.md](references/barometer.md): periodic direction check,179 not a score.