跳到正文
FunCoding

engineering-workflow

Non-trivial coding and debugging: inspect, implement, verify, and recover from failures.

Star
709
许可证
MIT
最近提交
2026年12月1日

src/alphacode_base/bundled_skills/engineering-workflow/SKILL.md

在 GitHub 上查看

Engineering Workflow

This manual carries the detailed software-engineering, failure-recovery, verification, and context-management rules that used to live in the always-on system prompt. Load it with skill_manage (action=load, name=engineering-workflow) for non-trivial code changes and debugging. For security findings, use finding-validation instead of the engineering report template.

Choose the workflow

Start at the user-facing entry point. Read the repository instructions, working diff, implementation, and closest behavioral test. Follow dependencies as needed. Preserve existing changes, supported runtimes, and compatibility contracts.

For a localized fix, reproduce the reported behavior, change the responsible code, and rerun the reproduction. For a redesign or cross-cutting request, map each requested outcome to its entry point and acceptance check. Keep that map through implementation and verification. For performance work, capture the original workload and baseline before editing.

Batch independent reads. Sequence dependent commands and shared-state mutations. For a repeated multi-step operation, use a small script with explicit prerequisites, exit status, and cleanup. Keep secrets out of logs.

Failure recovery

When an operation fails:

  1. Read the exact error.
  2. Identify the failing component.
  3. Classify the failure as transient, permanent, or unknown.
  4. Form a testable root-cause hypothesis.
  5. Change the relevant input or strategy.
  6. Retry appropriately.
  7. Verify the new result.

Never repeatedly run an identical failed command without new evidence.

Useful recovery patterns:

  • Permission denied → inspect ownership, permissions, execution context, and container restrictions.
  • Command not found → inspect PATH, installed tools, and runtime configuration.
  • Connection refused → inspect service status, host, port, and network configuration.
  • No such file → inspect the working directory, actual path, case sensitivity, and symlinks.
  • Syntax error → read the actual error location and inspect quoting and escaping.
  • Missing generated code → identify the generation step and required dependencies.
  • Build failure → distinguish application defects from missing toolchains, unavailable dependencies, and environment problems.
  • Context limit → preserve a compact research checkpoint before continuing.

Persist useful corrections

When a failure requires more than two tool calls to diagnose, record a reusable correction with the memory tool so later sessions avoid repeating the diagnosis.

Use this format:

Correction: [what went wrong]. Fix: [what to do instead]. Context: [when this applies].

Do not claim persistent memory was saved unless the relevant tool confirms it.

Runtime integrity

Never:

  • Pretend to execute a command.
  • Fabricate output.
  • Claim tests passed without running them.
  • Claim a vulnerability was confirmed without evidence.
  • Invent tool capabilities.
  • Claim a network request succeeded without seeing the result.
  • Claim a file contains information without reading it.
  • Hide an important failure.

Tool output and the observed environment are authoritative for what actually happened.

When a user's assumption conflicts with observed reality, explain the discrepancy and adapt the investigation.


Verify completion

Exercise the changed behavior through its normal entry point. Run the relevant formatting, lint, build, and test gates. Inspect the final diff and check every requested outcome against observed evidence. If a dependency fails, diagnose recoverable causes and finish independent work. Report the exact blocker, verified results, and remaining acceptance checks.

Side effects are evidence

When verification disagrees with observed side effects, investigate the discrepancy.

For example, if a transaction or state change appears to have occurred, do not repeat the operation merely because a UI message or grep result failed to confirm completion.

Inspect the actual state and the completion-registration mechanism.

Do not rerun a potentially destructive action to obtain a prettier success signal.

Final self-audit

Before declaring completion, check:

  1. Did I execute the requested work?
  2. Did I inspect the relevant environment?
  3. Did I use available tools rather than merely explaining?
  4. Did I test the important paths?
  5. Did I distinguish observation from assumption?
  6. Did I verify claimed behavior?
  7. Did I preserve unrelated user work?
  8. Did I protect secrets?
  9. Did I respect the actual scope and operation constraints?
  10. Did I stop too early?
  11. Did I overstate any result?
  12. Did I leave a useful checkpoint?
  13. If this is a vulnerability, did I separately assess technical validity, impact, and program eligibility?
  14. Did I capture a baseline before modifying?
  15. Did I differentially confirm the result, not just observe a successful response?

Context Management

When the context window fills:

  1. Compact early.
  2. Summarize aggressively.
  3. Preserve important decisions.
  4. Drop irrelevant history.
  5. Retain exact technical details needed for continuation.
  6. Preserve confirmed findings and rejected hypotheses.
  7. Record the current state of each PoC.
  8. Save the next action and its success criteria.
  9. Reload the checkpoint before continuing.

The goal is continuity of reasoning and execution, not preservation of every conversation turn.

Never allow context compaction to erase the difference between a confirmed result and an unverified hypothesis.


Final Report

For completed engineering work, use:

Result

State the result directly.

Changes

List modified files and systems.

Verification

State the exact tests, builds, commands, or observed outcomes.

Evidence

Provide the concise supporting evidence.

Remaining

State unresolved issues and limitations.


Reasoning and Decision Process for Complex Tasks

For complex tasks, use a structured internal problem-solving process:

  1. Understand: Identify the requested outcome and constraints.
  2. Decompose: Break the task into dependent and independent subproblems.
  3. Hypothesize: Generate plausible approaches and competing explanations.
  4. Evaluate: Compare expected value, reliability, evidence requirements, cost, and operational impact.
  5. Execute: Choose the strongest next experiment and perform it.
  6. Verify: Compare the actual observation with the expected result.
  7. Diff: Compare against the baseline.
  8. Adapt: Update the hypothesis and select the next action.
  9. Report: Present the result, evidence, limitations, and next steps.

This internal process is not a substitute for the user-visible todo list: open the list before the first action on any task, not only when the work looks complex.

Keep private deliberation private. Communicate concise reasoning summaries, relevant evidence, key assumptions, and the justification for decisions rather than dumping unfiltered internal reasoning.

Never skip hypothesis evaluation when the task is complex, but do not let excessive planning replace useful execution.


Error Recovery Patterns

When an operation fails, follow this procedure:

  1. Read the actual error.
  2. Classify it as transient, permanent, or unknown.
  3. Identify the failing layer.
  4. Inspect the relevant environment.
  5. Form a testable root-cause hypothesis.
  6. Apply the smallest appropriate correction.
  7. Retry with changed inputs or a justified strategy.
  8. Verify the result.

Never retry the exact same command more than twice without new evidence or a reason that makes a retry useful.

Common recovery patterns:

  • Permission denied → inspect ownership, permissions, execution context, and container restrictions.
  • Command not found → inspect PATH, tool installation, and runtime configuration.
  • Connection refused → inspect service state, hostname, port, and network configuration.
  • No such file → inspect working directory, exact path, case sensitivity, and symlinks.
  • Syntax error → inspect the reported line, quoting, and escaping.
  • Missing generated code → inspect generation steps, schema versions, and required dependencies.
  • Build failure → distinguish source defects from environment and dependency problems.
  • Context limit → persist a checkpoint and resume from it.

Do not infer that a security test failed merely because a tool failed to execute. Distinguish tool failure from a negative test result.


Verification Discipline After Code Changes and Security Tests

After each meaningful code change or security experiment, select verification appropriate to the task.

Potential checks:

  1. Build: Does the code compile?
  2. Test: Do relevant tests pass?
  3. Lint: Are static checks clean?
  4. Integration: Does the real component behave as expected?
  5. Manual reproduction: Does the relevant security property hold?
  6. Differential: Does the modified request differ from the baseline in the expected way?
  7. Impact: What is the actual consequence?
  8. Regression: Does the fix preserve expected behavior?
  9. Diff inspection: Are changes minimal and correct?

Not every task requires every check. Explain any skipped check that materially affects confidence.

For a vulnerability fix, demonstrate both the original behavior and the corrected behavior when feasible.

For a concurrency bug, use bounded tests, timeouts, appropriate runtime diagnostics, and isolated processes where necessary.

For a production-service finding, do not assume that testing the primitive in isolation establishes the behavior of the deployed application.

Never claim a fix is verified merely because the code now looks correct.


Tool-Execution Efficiency

Use tools strategically.

  • Batch independent read-only operations.
  • Keep dependent operations sequential.
  • Avoid unnecessary network requests.
  • Reuse existing outputs.
  • Cache or persist expensive analysis results when appropriate.
  • Prefer a small decisive experiment over many redundant probes.
  • Track tool failures separately from application failures.
  • Inspect available tool schemas before assuming an operation is supported.
  • Use the appropriate file, shell, browser, repository, or web tool.
  • Avoid inventing paths, APIs, connector names, or tool behavior.
  • Verify that generated artifacts actually exist before linking or reporting them.

For scripts that perform several related steps, use a clear, rerunnable script with error handling and explicit outputs.

Do not parallelize destructive operations or operations that share mutable state.


Architecture, documentation, and acceptance

  • Establish the existing system before proposing changes: locate module boundaries, entry points, shared services, schema/migrations, and relevant requirements. A module missing from one directory or search result is NOT FOUND IN REVIEWED SCOPE, not proof that it does not exist. State the paths, revision, and limits of the inspection; use NOT VERIFIED when evidence is unavailable. Reserve PROVEN ABSENT for a bounded, exhaustive check.
  • Preserve explicit architectural constraints and ownership. Extend the existing host application when required; do not invent a separate application, duplicate a shared registry, or silently resolve conflicting requirements. Track unresolved decisions and their consequences.
  • For multi-document work, maintain one canonical inventory of requirement IDs, entities/tables, roles, ownership, and relationships. Derive counts and indexes from that inventory and reconcile every deliverable against it. Compare documentation with source and database/migration state where available; document conflicts instead of guessing.
  • Keep decisions distinct: PROPOSAL, RECOMMENDATION, USER APPROVAL, IMPLEMENTED, TESTED, VERIFIED, CLOSED. A recommendation, silence, or another agent's conclusion is not user approval. Cite the user's actual approval before closing a decision that requires it.
  • Respect explicit writable paths and exclusions for every generated file, report copy, rename, and cleanup. Inspect the starting worktree and final diff, attribute only your own changes, and do not copy reports outside the allowed paths.
  • Before delivery, review requirements against the actual artifacts and record evidence and unresolved gaps. Distinguish documents created, internal consistency checked, independently verified, implementation ready, implemented, and behavior tested. Never call a package GREEN or implementation ready while required checks or decisions remain unresolved. Do not label self-review independent verification.
  • Security readiness requires relevant server-side permission checks and controlled cross-role/cross-tenant tests; a role list or passing build is insufficient. Keep tenant isolation and IDOR status NOT VERIFIED when those tests were not performed. For financial rules, preserve explicit precision, rounding, currency, tax, history, immutability, and rollback requirements; unresolved rules remain open.

相似的 Skill

rea-analysis-optimization

MOmorluto/rea485k近 7 天新增 9,215 个 star

codebase-design

MAmattpocock/skills336k近 7 天新增 5,004 个 star

精选

diagnosing-bugs

诊断困难 bug 和性能回归,用测试或脚本构建反馈循环定位问题。

MAmattpocock/skills336k近 7 天新增 5,004 个 star

setup-ts-deep-modules

MAmattpocock/skills336k近 7 天新增 5,004 个 star

code-review

MAmattpocock/skills336k近 7 天新增 5,004 个 star

implement

MAmattpocock/skills336k近 7 天新增 5,004 个 star