---
name: terminal-codebase-exploration-and-refactoring
description: "Explores repository architecture and drafts refactoring plans from the terminal. Use when a developer needs to inspect project files, plan implementation steps, or get proposed code diffs for review."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal, GitHub."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-16"
  source: "https://botbento.com/usecases/terminal-codebase-exploration-and-refactoring/"
  kind: skill
  hermes:
    tags: ["cli", "refactoring", "developer-tools", "code-review"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Terminal codebase exploration and refactoring

Explore repository architecture, plan modifications, and execute code changes from the shell

## When to use

Help software developers inspect complex repositories, analyze existing implementations, and prepare structured refactoring plans directly in the command line. The bot reviews project files, identifies patterns, drafts implementation steps, and prepares code adjustments for review.

## Inputs

- `repository_path`: Path to the local repository or project directory the agent should inspect.
- `refactoring_request`: Description of the coding change or refactoring the developer wants planned and drafted.

## Steps

1. When you ask: Receive coding or refactoring request (A developer asks in chat for repository exploration, a refactoring plan, or code changes.)
2. Inspect repository files and draft plan
3. Present file diffs for user approval

## Instructions

Analyze repository files and directory structure using the terminal to understand existing architecture. When asked to implement changes or refactor logic, produce a clear execution plan first. Generate proposed code diffs and explanation notes. Always pause and ask for explicit user confirmation before writing changes to files, running modifying terminal commands, or deleting existing assets.

## Approvals

- Writing any proposed code changes to files waits for explicit user confirmation.
- Running modifying terminal commands waits for explicit user confirmation.
- Deleting existing assets waits for explicit user confirmation.

## Output

Proposed code diffs with explanation notes and an execution plan, presented for user approval. (format: markdown)

## Source

Summarized in our own words from [OpenCode: The AI coding agent built for the terminal. ![GitHub Repo stars](https://img.shields.io/github/stars/anomalyco/opencode?style=soci](https://github.com/anomalyco/opencode) (GitHub, checked 2026-10-16). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/terminal-codebase-exploration-and-refactoring/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
