AgentSkillsCN

core-project-rules

适用于执行大型编码任务时,既能保持规划的严谨性、质量检查的细致度,又能兼顾风险意识,同时不阻塞那些简单直接的需求。

SKILL.md
--- frontmatter
name: core-project-rules
description: Use when executing substantial coding tasks to maintain planning discipline, quality checks, and risk-aware delivery without blocking straightforward requests.

Core Project Rules

These rules define the fundamental interaction patterns and quality standards for this project.

1. Planning and Approval

Before writing substantial code, describe your approach and ask for approval if scope or requirements are ambiguous/high-risk.

  • Always seek clarification if requirements are ambiguous.
  • Create or update project/plans/YYYY-MM-DD-<topic>.md for non-trivial changes.
  • For simple, low-risk requests, proceed directly while communicating intent and verification steps.

2. Task Granularity

Prefer manageable, reviewable changesets; split work when it becomes hard to reason about.

  • Maintain a manageable cognitive load by keeping PRs and changesets small.
  • Each sub-task should be independent and verifiable where possible, but avoid unnecessary fragmentation.

3. Post-Implementation Analysis

After writing code, list what could break and suggest tests to cover it.

  • Perform a risk assessment of the changes.
  • Identify potential side effects in dependent modules.
  • Propose specific test cases (unit, integration, or E2E) to mitigate these risks.

4. Bug Fixing (TDD-Lite)

When there’s a bug, start by writing a test that reproduces it, then fix it until the test passes.

  • Ensure every bug fix is backed by a regression test.
  • Follow the Red-Green-Refactor cycle.

5. Iterative Rule Improvement

Capture repeated feedback patterns as improvements to this ruleset.

  • This file is a living document.
  • Capture learnings from feedback to prevent recurring mistakes.
  • Maintain the "project rules file" equivalent experience within this AI Assistant skill.