AgentSkillsCN

impl

落实所要求的代码变更,并补充全面的测试覆盖,确保测试在 Linux、macOS 与 Windows 平台上均能顺利通过。适用于需要实际执行实现工作(而不仅仅是规划)且必须包含测试的场景。

SKILL.md
--- frontmatter
name: impl
description: Implement the requested code change and add comprehensive test coverage, ensuring tests pass across Linux, macOS, and Windows. Use when you need to execute implementation work (not just planning) and must include tests.

Implementation (with Tests)

Use this skill when the user asks you to implement a change in the codebase (not just propose a plan) and expects comprehensive tests and cross-platform reliability.

Instructions

  1. Understand the request and scope

    • Restate the requested behavior change in your own words.
    • Identify files/modules likely affected.
    • Confirm any ambiguous requirements before coding.
  2. Establish baseline

    • Run the repo’s existing lint/build/test commands to understand the current baseline.
    • If baseline fails, only address failures that are required for the requested change.
  3. Implement the change (minimal, surgical edits)

    • Make the smallest possible code changes to achieve the requested behavior.
    • Prefer existing patterns and utilities already used in the repo.
  4. Add comprehensive tests

    • Add or update tests to cover:
      • Happy path
      • Key edge cases
      • Regression coverage for the bug/behavior being changed
    • Ensure tests avoid OS-specific path assumptions (use path helpers, normalize separators, etc.).
  5. Run the full test suite

    • Ensure all tests pass.
    • If tests are flaky or OS-dependent, fix the test to be deterministic.
  6. If a plan file exists, keep it updated

    • If a plan markdown file is provided with task checkboxes, mark tasks complete as you finish them.
  7. Commit when clean

    • When tests pass, create a commit with a clear message describing the change and test additions.
  8. Archive the task file (if applicable)

    • If the task/plan file you followed lives under .vscode/, archive it after the commit succeeds:

      bash
      python3 .github/skills/impl/scripts/archive-task-file.py --task <path-to-task-file>
      
    • This moves the file into .vscode/tasks/archive/ (no-op if the file is not under .vscode/).

Notes

  • Prefer existing repo commands (e.g. npm test, npm run lint) rather than introducing new tooling.
  • If the user requests a change that impacts multiple packages/workspaces, ensure the relevant package tests run as well.

References

  • impl.prompt.md - Original short-form prompt this skill was derived from.

Scripts

  • scripts/archive-task-file.py - Moves a task file under .vscode/ into .vscode/tasks/archive/ after a successful commit.