بنقرة واحدة
explore
Codebase exploration — find integration points, existing patterns, and related code
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Codebase exploration — find integration points, existing patterns, and related code
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Install Pasture binaries (pastured, pasture, pasture-release) from GitHub Releases, go install, or Nix
Pasture protocol reference documentation — 12-phase workflow, agent roles, constraints, and coding standards. Read when you need to understand the full workflow or look up conventions.
Create handoff document and transfer to supervisor
Create PROPOSAL-N task with full technical plan
Ratify proposal, mark old proposals pasture:superseded
Spawn 3 axis-specific reviewers (A/B/C)
| name | explore |
| description | Codebase exploration — find integration points, existing patterns, and related code |
Command: pasture:explore — Codebase exploration — find integration points, existing patterns, and related code
General-purpose codebase exploration skill. Searches the codebase for integration points, existing patterns, data flow, dependencies, and potential conflicts relevant to a topic or feature.
See ../protocol/CONSTRAINTS.md for coding standards.
[explore-topic-structured]
[explore-depth-quick-scan]
[explore-depth-standard-research]
[explore-depth-deep-dive]
[explore-code-refs]
file:line citation format[explore-phase1-recording]
bd comments add/pasture:user-request after user confirms research depth. Findings recorded as REQUEST task comment.| Parameter | Required | Description |
|---|---|---|
topic | Yes | The feature or concept to explore (e.g., "session management", "CLI command registration") |
depth | Yes | One of: quick-scan, standard-research, deep-dive |
request-task-id | Phase 1 only | Beads task ID to record findings as comment |
Where would this feature plug in?
What existing data structures, types, or schemas are relevant?
What modules/packages would this feature depend on or extend?
How do similar features work in this codebase?
Are there existing implementations that would need modification or could conflict?
| Depth | Scope | Tools | Deliverable |
|---|---|---|---|
| quick-scan | Grep for keywords, check obvious entry points, scan file tree | Glob, Grep | 1-paragraph summary per checklist item |
| standard-research | Trace data flow, map dependencies, read related modules, check test patterns | Glob, Grep, Read | Per-section structured findings with file:line citations |
| deep-dive | Full dependency graph, architectural analysis, identify all touchpoints, trace transitive consumers | Glob, Grep, Read, Bash (build/dep tools) | Complete architectural map with dependency diagram and risk assessment |
## Explore Findings: <topic>
**Depth:** <quick-scan|standard-research|deep-dive>
**Date:** <YYYY-MM-DD>
### Entry Points
| File | Line | Type | Description |
|------|------|------|-------------|
| `src/cli/commands.ts` | 42 | CLI subcommand | `register` function adds command to CLI router |
| `src/api/routes.ts` | 118 | HTTP handler | `POST /sessions` endpoint |
### Data Flow
User input → CLI parser (src/cli/parse.ts:30) → Command handler (src/commands/session.ts:15) → Service layer (src/services/session.ts:42) → Repository (src/db/session-repo.ts:28) → Database
**Relevant types:**
- `SessionConfig` at `src/types/session.ts:12` — configuration schema
- `SessionState` at `src/types/session.ts:45` — runtime state enum
### Dependencies
**Direct:**
- `src/services/session.ts` imports `src/db/session-repo.ts`
- `src/commands/session.ts` imports `src/services/session.ts`
**Shared utilities:**
- `src/utils/logger.ts` — structured logging (used by all services)
- `src/utils/config.ts` — configuration loader
**External:**
- `better-sqlite3@11.0.0` — database driver
- `zod@3.23.0` — schema validation
### Existing Patterns
**Naming:** Commands use `<verb>-<noun>.ts` (e.g., `create-session.ts`)
**DI:** Constructor injection via factory functions (see `src/services/index.ts:20`)
**Tests:** Vitest with `describe/it` blocks, fixtures in `tests/fixtures/`
**Errors:** Custom error classes extending `AppError` at `src/errors/base.ts:5`
### Conflicts
- `src/services/auth.ts:88` — existing session cleanup logic may overlap
- `src/types/session.ts:45` — `SessionState` enum may need new values
- No import cycles detected
When invoked as part of Phase 1 (s1_3-explore), record findings on the REQUEST task:
bd comments add {{request-task-id}} \
"Explore findings ({{depth}}):
- Entry points: {{list of files/functions with line numbers}}
- Related types: {{existing types/schemas with locations}}
- Dependencies: {{modules this would use}}
- Patterns: {{how similar features work here}}
- Conflicts: {{potential issues or 'none'}}"
When used outside Phase 1, produce the structured findings directly as output. No beads comment is needed unless a task ID is provided.
/pasture:explore
Topic: "Nix flake module system"
Depth: deep-dive
This produces the full architectural map without requiring a REQUEST task context.