Skill: xinyue-wang/xinywacodinghelper (version 1.0.2)

# Skill: Safe Brownfield Code Change ## Purpose Perform safe, minimal, production-quality code changes across large repositories with resumable execution and machine-optimized indexing. --- ## Skill Routing Requirement This skill MUST only run for COMPLEX_CODE_TASK. --- ## Mandatory Repo Access Check (CRITICAL) Before execution: * identify repo paths * verify accessibility * verify required files exist If failed: ``` [Error] Type: REPO_ACCESS_FAILURE Missing: <path> Reason: <why> Required: <what needed> ``` DO NOT proceed. --- ## Execution Visibility (CRITICAL) * NEVER run silently * ALWAYS output progress per step * MUST include status: IN_PROGRESS | BLOCKED | COMPLETED --- ## Fail-Fast Handling Immediately stop if: * repo checkout timeout (e.g. 78K files case) * filesystem too large / slow * command fails repeatedly Output: ``` [Error] Type: INFRASTRUCTURE_FAILURE Stage: <stage> Reason: <message> Fix: <action> ``` --- ## Phase 1: Progressive Understanding ### Rules * DO NOT scan full repo blindly * DO incremental expansion only * ALWAYS log progress * ALWAYS resumable --- ### Process 1. start from entry points 2. expand to dependencies 3. stop when change point identified --- ### Mandatory Output ``` [Understand] File: <path> Summary: <short machine summary> Next: <files to explore> ``` --- ### Resume Rule * check progress.log * skip already processed files * continue from last step --- ## Repository Index (Machine Optimized) ### Location /home/vibe/aksclaw-data/index/<repo>/ --- ### Structure file_index.json: ```json { "file": { "symbols": ["funcA", "typeB"], "deps": ["fileX"], "last_used": "ts" } } ``` --- ### Rules * update index after reading file * reuse index before reading * prefer index over re-scan * DO NOT generate human-readable summaries --- ## Phase 2: Plan * minimal change only * prefer: 1. local code 2. repo pattern 3. k8s pattern --- ## Phase 3: Implement * smallest safe change * no refactor --- ## Phase 4: Validate * add/update tests * coverage target: 80% (if measurable) --- ## Phase 5: Review check: * correctness * race conditions * retry/idempotency * debuggability --- ## Confidence & Early Stop Compute confidence: 0.0–1.0 based on: * correctness * validation * risk --- ### Stop if: * confidence ≥ 0.85 * no major issue * no failing tests --- ### Output ``` [Confidence] Score: <0-1> Reason: <why> Gaps: <missing> ``` --- ## Run Output (MANDATORY) /home/vibe/aksclaw-data/runs/<run_id>/ must include: * progress.log * steps/ * final_output.md * error.log (if failed) --- ## Cleanup COMPLETED: * keep summary only FAILED: * keep all logs --- ## Hard Rules * NEVER guess missing info * NEVER skip phases * NEVER run silently * MUST follow Execution Visibility * MUST avoid using skill for simple tasks --- ## Mental Model This is a controlled execution system, not free-form coding.

path: ROUTING.md
content: # Skill Routing

Classify request:

---

## SIMPLE_CODE_TASK

* small snippet
* isolated change

→ respond directly

---

## COMPLEX_CODE_TASK

* multi-file
* repo context
* debugging
* production-safe change

→ use Safe Brownfield Code Change

---

## NON_CODE_TASK

* explanation
* design

→ normal response

---

## Rule

ONLY trigger skill for COMPLEX_CODE_TASK


path: WATCHER.md
content: # Watcher

## Purpose

Ensure execution is:

* progressing
* correct
* visible

---

## After each step

Check:

* progress made?
* repeated action?
* phase valid?

---

## Output

```
[Watcher]
Status: OK | WARNING | BLOCKED
Reason: <why>
Correction: <next step>
```

---

## BLOCK conditions

* no progress
* repeated step
* missing repo access
* skipped understanding
* silent execution

---

## Authority

* STOP execution on BLOCKED


path: RECOVERY.md
content: # Recovery System

Triggered when BLOCKED

---

## Failure Types

* REPO_ACCESS_FAILURE
* INFRA_FAILURE
* MISSING_INFO
* NO_PROGRESS

---

## Strategy

### Repo failure

→ ask for path or fix access

### Infra failure

→ fail fast (no retry)

### Missing info

→ read more files

### No progress

→ change approach

---

## Retry Rules

* max 2 retries
* must change strategy

---

## Output

```
[Recovery]
Type: <type>
Action: <what done>
Next: <next step>
```

---

## Rule

Recovery ≠ blind retry


path: templates/progress_template.md
content: [Task]

[Phase]

[Repo Access]

* repo:
* path:
* status:

[Index]

* used:
* updated:

[Files Read]

[Understanding]

[Plan]

[Changes]

[Tests]

[Risks]

[Next Step]

[Status]


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)