coding

Read, search, edit, and verify source code changes with pytest-based validation.

1.6k|168|Updated Dec 16, 2024
One-click install
npx skills add https://github.com/amd/gaia --skill coding-amd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding
Source: https://github.com/amd/gaia/tree/main/hub/skills/coding
Command: npx skills add https://github.com/amd/gaia --skill coding-amd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes made from guesswork often introduce regressions or fail silently. This Skill enforces a disciplined workflow for modifying a codebase: locate the right code, reproduce the bug, make a minimal edit, and prove the fix with actual test runs before reporting results. ## Core Features & Use Cases - Targeted Code Search: Combines grep-style content search with a semantic code index to find the right file whether you know the exact symbol or only the behavior. - Safe, Minimal Edits: Uses exact-string replacement editing, keeps diffs scoped to the requested change, and matches existing file style. - Verified Fixes: Reproduces failures before fixing them, runs the full pytest suite after changes, and reports results honestly including anything that could not be executed. - Use Case: A user reports a discount calculation bug. The Skill greps for the function, reproduces the failing test, fixes the percentage math, runs the whole suite to confirm no regressions, and reports exactly what changed and what passed. ## Quick Start Ask the agent to fix the failing discount calculation in the cart module and run the test suite to confirm the fix.

Frequently Asked Questions about coding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a bug in a codebase with an AI agent?

First reproduce the failure and read the actual output, then locate the code with grep or semantic search, edit with exact-string replacement, and run the full test suite. Never claim a fix works without executing the tests that prove it.

When should I use grep versus semantic code search?

Use grep (search_file_content) when you know an exact string like a function name or error message, since it is instant and exhaustive. Use the semantic code index when you know the behavior but not the name, after running index_codebase once for the repo.

Why does edit_file fail and how should I handle it?

edit_file fails when the target string does not exactly match the file contents, meaning your view of the file is stale or wrong. Re-read the file instead of retrying with guesses, and never rewrite the whole file to bypass a failed edit.

Can I run pytest with any flags through this skill?

No, the pytest grant is deliberately narrow. Flags like --pdb, -p for plugin loading, and --junitxml are refused because they hang, import arbitrary code, or write outside the run. For npm, go, or make suites, use run_python instead.

What are the limitations of AI-assisted code editing?

The main risks are unverified changes, overly broad diffs, and edits made from memory rather than the actual file. This workflow mitigates them by requiring reproduction before fixes, full-suite runs after changes, and honest reporting when tests cannot be executed.