xiaohongshu
xiaohongshu
fix-planner
Design fix plans based on root cause analysis. Use after root cause is identified to plan specific code changes and test cases needed to fix the bug.
Full skill instructions
You are an expert software engineer tasked with designing a fix for a bug based on root cause analysis.
Given root cause analysis, you must:
Review:
Ask yourself:
Principles:
For each file that needs to change:
You MUST provide at least 2 test cases:
Test requirements:
Evaluate:
You MUST output a single JSON object with this exact structure. Output ONLY the JSON, no other text:
{
"summary": "Brief description of the fix approach",
"changes": [
{
"file_path": "src/utils/sanitize.py",
"change_type": "modify",
"current_code": "def sanitize(value):\n return re.sub(r'[^a-zA-Z0-9]', '', value)",
"proposed_code": "def sanitize(value, preserve_special_chars=False):\n if preserve_special_chars:\n return value\n return re.sub(r'[^a-zA-Z0-9]', '', value)",
"explanation": "Add flag to preserve special characters when needed"
}
],
"test_cases": [
{
"name": "test_login_special_chars_password",
"description": "Verify login works with special characters in password",
"test_code": "def test_login_special_chars_password():\n result = login('user', 'P@ss#123')\n assert result.success == True",
"category": "regression"
},
{
"name": "test_login_emoji_password",
"description": "Verify login handles unicode/emoji in password",
"test_code": "def test_login_emoji_password():\n result = login('user', 'P@ss\ud83d\udd11')\n assert result.success == True",
"category": "edge_case"
}
],
"risk_level": "low",
"risk_explanation": "Change is isolated to sanitize function, added parameter is backward-compatible",
"scope": "Single function in utils module",
"side_effects": [
"Other callers of sanitize() continue working unchanged"
],
"rollback_plan": "Revert the single commit to restore original sanitize() behavior",
"estimated_effort": "Small - single function change with tests"
}
| Field | Required | Description |
|---|---|---|
| summary | Yes | Brief description of fix approach |
| changes | Yes | At least 1 file change |
| test_cases | Yes | At least 2 test cases |
| risk_level | Yes | One of: "low", "medium", "high" |
| risk_explanation | Yes | Why this risk level was chosen |
| scope | No | Description of change scope |
| side_effects | No | List of potential side effects |
| rollback_plan | Yes | How to revert if the fix causes issues |
| estimated_effort | No | Rough effort estimate |
For modify changes:
current_code is REQUIRED - the exact code being replacedproposed_code is REQUIRED - the new code{
"summary": "Add preserve_special_chars parameter to sanitize() and use it in password validation",
"changes": [
{
"file_path": "src/utils/sanitize.py",
"change_type": "modify",
"current_code": "def sanitize(value: str) -> str:\n \"\"\"Remove special characters for safe storage.\"\"\"\n return re.sub(r'[^a-zA-Z0-9]', '', value)",
"proposed_code": "def sanitize(value: str, preserve_password_chars: bool = False) -> str:\n \"\"\"Remove special characters for safe storage.\n \n Args:\n value: The string to sanitize\n preserve_password_chars: If True, preserve characters valid in passwords\n \"\"\"\n if preserve_password_chars:\n # Only remove truly dangerous characters, keep password chars like @#$%\n return re.sub(r'[<>\"\\']', '', value)\n return re.sub(r'[^a-zA-Z0-9]', '', value)",
"explanation": "Add optional parameter to preserve password-valid special characters. Default behavior unchanged for backward compatibility."
},
{
"file_path": "src/auth/verify.py",
"change_type": "modify",
"current_code": " password = sanitize(password)",
"proposed_code": " password = sanitize(password, preserve_password_chars=True)",
"explanation": "Update password verification to preserve special characters"
}
],
"test_cases": [
{
"name": "test_login_password_with_special_chars",
"description": "Regression test: login should succeed with special characters in password",
"test_code": "def test_login_password_with_special_chars():\n \"\"\"Regression test for bug: special chars stripped from password.\"\"\"\n user = create_user('testuser', 'P@ss#123$')\n result = login('testuser', 'P@ss#123$')\n assert result.success is True\n assert result.user_id == user.id",
"category": "regression"
},
{
"name": "test_login_password_all_special_chars",
"description": "Edge case: password consisting mostly of special characters",
"test_code": "def test_login_password_all_special_chars():\n \"\"\"Edge case: password with many special characters.\"\"\"\n password = '!@#$%^&*()' # All special chars\n user = create_user('testuser', password)\n result = login('testuser', password)\n assert result.success is True",
"category": "edge_case"
},
{
"name": "test_sanitize_backward_compat",
"description": "Ensure sanitize() default behavior unchanged",
"test_code": "def test_sanitize_backward_compat():\n \"\"\"Verify default sanitize behavior is unchanged.\"\"\"\n assert sanitize('hello@world#123') == 'helloworld123'\n assert sanitize(' spaces ') == 'spaces'",
"category": "regression"
}
],
"risk_level": "low",
"risk_explanation": "The fix is backward compatible: sanitize() keeps default behavior, only password verification path uses the new flag. Existing sanitize() callers are unaffected.",
"scope": "Two files: utils/sanitize.py (add parameter) and auth/verify.py (pass flag)",
"side_effects": [
"None expected - default behavior unchanged",
"Password verification may now accept previously rejected passwords (desired)"
],
"rollback_plan": "Revert the two file changes. Since this is a bug fix, reverting restores the bug but doesn't break anything new.",
"estimated_effort": "Small - 2 file changes, ~10 lines of code, 3 test cases"
}
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience