AgentSkillsCN

strict-implementation-rules

严格执行各项实施规则。无论是 MVP 还是全范围实施,都需遵守反虚假规则,并落实真实测试要求。所有迁移与重构工作均须严格参照这些规则。

SKILL.md
--- frontmatter
description: Strict implementation enforcement rules. MVP/Full scope enforcement, anti-dummy rules, and real testing requirements. MUST be referenced during all migration and refactoring work.
name: strict-implementation-rules

Strict Implementation Rules

CRITICAL: These rules are NON-NEGOTIABLE

Violation of any rule below results in immediate work rejection.


Rule 1: Scope Commitment Enforcement

The Contract

When user selects scope (MVP or Full), that decision is BINDING.

code
┌─────────────────────────────────────────────────────────────┐
│  SCOPE SELECTION IS A CONTRACT, NOT A SUGGESTION           │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  User selects "Full Migration"                              │
│       ↓                                                     │
│  Agent MUST implement ALL features completely               │
│       ↓                                                     │
│  NO shortcuts, NO "we can add this later"                   │
│       ↓                                                     │
│  If blocked, ASK USER - never self-decide to reduce scope   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

MVP Selection

When user selects MVP:

  • Define exact MVP scope with user BEFORE starting
  • Document what is IN and what is OUT
  • Implement ONLY what's in MVP scope
  • Everything in MVP must be COMPLETE (no half implementations)

Full Selection

When user selects Full:

  • Implement EVERYTHING specified
  • No arbitrary scope reduction
  • No "simplified versions"
  • No "placeholder for future implementation"
  • If something is technically impossible, STOP and discuss with user

FORBIDDEN Behaviors

BehaviorWhy Forbidden
"For MVP, I'll just..." (when Full selected)Unauthorized scope change
"We can add this later"Incomplete implementation
"This is a simplified version"Not what user requested
"To save time, I'll..."Prioritizing speed over correctness
Silently reducing featuresBreach of contract

Rule 2: Testing Requirements

Two-Phase Testing is MANDATORY

Every implementation must pass BOTH phases:

code
Phase 1: Static Testing
├── Import/syntax validation
├── Type checking
├── Linting
└── Unit tests with mocks

Phase 2: Real User Simulation Testing
├── Actual build execution
├── Real service calls (if LLM service: real prompt → real response)
├── End-to-end workflow verification
└── User journey simulation

Static Testing (Phase 1)

  • Import resolution
  • Syntax validation
  • Type checking (if typed language)
  • Unit tests with appropriate mocking
  • Linting rules

Real User Simulation Testing (Phase 2)

CRITICAL: This is NOT optional

If Project TypeMust Test
Web ApplicationReal browser interaction, form submission, navigation
API ServiceReal HTTP requests, actual responses
LLM ServiceReal prompt input, actual LLM API call, response validation
CLI ToolReal command execution, actual output
LibraryReal import, actual function calls

Example for LLM Service:

code
NOT ACCEPTABLE:
- Mock LLM response
- Hardcoded expected output
- "Assuming LLM returns X..."

REQUIRED:
- Send actual prompt to LLM API
- Receive actual response
- Validate response format and content
- Test error handling with real errors

Rule 3: Implementation Quality Standards

STRICTLY FORBIDDEN

PatternDetection MethodSeverity
// TODOGrep scanCRITICAL
// FIXMEGrep scanCRITICAL
throw new NotImplementedError()AST scanCRITICAL
pass (Python placeholder)AST scanCRITICAL
return null (without logic)AST scanHIGH
return {} (empty object placeholder)AST scanHIGH
return [] (empty array placeholder)AST scanHIGH
console.log("TODO")Grep scanCRITICAL
print("not implemented")Grep scanCRITICAL
Hardcoded values that should be configurableManual reviewHIGH
Magic numbers without constantsManual reviewMEDIUM
Commented-out code blocksGrep scanMEDIUM
any type (TypeScript) without justificationAST scanHIGH
Empty catch blocksAST scanCRITICAL
Functions with no implementationAST scanCRITICAL

Hardcoding Rules

Forbidden Hardcoding:

  • API endpoints
  • Credentials/secrets
  • Environment-specific values
  • User-facing strings (if i18n required)
  • Configuration values

Allowed Hardcoding:

  • Mathematical constants
  • Protocol specifications
  • Truly immutable values

Rule 4: Audit Checkpoints

When Audit MUST Run

  1. Before any test execution
  2. After each implementation phase
  3. Before marking task as complete

Audit Failure = Work Stoppage

If audit finds violations:

  1. STOP all work
  2. Report violations to user
  3. Fix ALL violations
  4. Re-run audit
  5. Only proceed when audit passes

Audit Report Format

markdown
## Implementation Audit Report

### Scope Compliance
- Selected: [MVP/Full]
- Implemented: [X of Y features]
- Status: [PASS/FAIL]

### Forbidden Pattern Scan
| Pattern | Occurrences | Files |
|---------|-------------|-------|
| TODO comments | 0 | - |
| ...

### Hardcoding Scan
| Type | Occurrences | Files |
|------|-------------|-------|
| API endpoints | 0 | - |
| ...

### Test Readiness
- Static tests: [READY/NOT READY]
- Real simulation tests: [READY/NOT READY]

### Verdict: [PASS/FAIL]

Rule 5: User Communication Protocol

MUST Ask User When:

  1. Scope needs ANY change
  2. Blocked by technical limitation
  3. Found ambiguity in requirements
  4. Test failure that suggests design issue
  5. Time estimate significantly changes

NEVER Assume:

  • "User probably meant..."
  • "This is close enough..."
  • "They won't notice if..."
  • "I'll fix this later..."

Enforcement Summary

Every implementation must be complete, tested with real user simulation, and free of dummy code. Scope changes require explicit user approval. Audit must pass before any task is marked complete. When in doubt, ASK - never assume or simplify without permission.