This file provides guidance to coding agents when working with code in this repository.
ampup is the official version manager and installer for Amp (a tool for building and managing blockchain datasets).
- Rust crate (
ampup/) — Theampupbinary, a CLI tool for installing, managing, and buildingampdversions
If you're an AI agent working on this codebase, here's what you need to know immediately:
- Use Skills for operations → Invoke skills (
/code-format,/code-check,/code-test,/code-review,/feature-discovery,/feature-fmt-check,/feature-validate) instead of running commands directly - Skills wrap justfile tasks → Skills provide the interface to
justcommands with proper guidance - Follow the workflow → Format → Check → Clippy → Targeted Tests (when needed)
- Fix ALL warnings → Zero tolerance for clippy warnings
- Check patterns → Use
/code-pattern-discoverybefore implementing code
Your first action: If you need to run a command, invoke the relevant Skill! If you need to implement code, invoke
/code-pattern-discovery to load relevant patterns!
Testing default: Run the smallest relevant test slice. Only broaden to just test for cross-cutting/high-risk changes or when you need broader confidence.
- Feature Discovery - Understanding project features via
/feature-discoveryskill - Coding Patterns - Understanding coding standards via
/code-pattern-discoveryskill - Development Workflow - How to develop with this codebase
- Additional Resources - Links to documentation
Feature documentation lives in docs/features/ with YAML frontmatter for dynamic discovery.
Feature docs are authoritative: If a feature doc exists, it is the ground truth. Implementation MUST align with documentation. If there's a mismatch, either fix the code or update the doc to reflect the correct state.
| When User Asks | Invoke This Skill |
|---|---|
| "What is X?", "How does X work?", "Explain the Y feature" | /feature-discovery |
| "What features does ampup have?", "What can this project do?" | /feature-discovery |
| Questions about project functionality or capabilities | /feature-discovery |
| Need context before implementing a feature | /feature-discovery |
Creating or editing files in docs/features/ |
/feature-fmt-check |
| Reviewing PRs that modify feature docs (format check) | /feature-fmt-check |
| "What's the status of feature X implementation?" | /feature-validate |
| Verify feature doc matches implementation | /feature-validate |
| Check if documented functionality exists in code | /feature-validate |
| Audit feature docs for accuracy and test coverage | /feature-validate |
Navigation:
- Need to understand a feature? →
/feature-discovery - Writing feature docs? →
/feature-fmt-check+ docs/meta/feature-docs.md - Validate implementation aligns with feature claims? →
/feature-validate
Coding pattern documentation lives in docs/code/ with YAML frontmatter for dynamic discovery.
Pattern docs are authoritative: Pattern docs define how code should be written. All implementations MUST follow the patterns. If code doesn't follow a pattern, either fix the code or update the pattern (with team approval).
| Type | Scope | Purpose |
|---|---|---|
| Core | global |
Fundamental coding standards (error handling, modules, types) |
| Architectural | global |
High-level patterns (crate structure, CLI design) |
| Crate-specific | crate:<name> |
Patterns for specific crates |
| Meta | global |
Documentation format specifications |
| When You Need To | Invoke This Skill |
|---|---|
| Understand coding patterns before implementing | /code-pattern-discovery |
| "How should I handle errors?", "What's the pattern for X?" | /code-pattern-discovery |
| Load crate-specific patterns for ampup | /code-pattern-discovery |
Creating or editing files in docs/code/ |
/code-pattern-fmt-check |
| Reviewing PRs that modify pattern docs | /code-pattern-fmt-check |
Navigation:
- Need to understand patterns? →
/code-pattern-discovery - Writing pattern docs? →
/code-pattern-fmt-check+ docs/meta/code-pattern-docs.md - All patterns located in
docs/code/
This section provides guidance for AI agents on how to develop with this codebase.
This project uses three complementary documentation systems. Understanding their roles helps AI agents navigate efficiently:
| Documentation | Purpose | Content Focus |
|---|---|---|
| AGENTS.md (this file) | WHY and WHAT | Project architecture, policies, goals, and principles. Answers "What is this project?" and "Why do we do things this way?" |
Skills (.agents/skills/) |
HOW and WHEN | Command-line operations and justfile usage. Answers "How do I run commands?" and "When should I use each command?" |
Patterns (docs/code/) |
HOW (implementation) | Code implementation patterns, standards, and guidelines (see Coding Patterns). Answers "How do I write quality code that follows project conventions?" |
Navigation Guide for AI Agents:
- Need to understand the project? → Read this file (AGENTS.md)
- Need to run a command? → Invoke the appropriate Skill (
/code-format,/code-check,/code-test,/code-review) - Need to write code? → Use
/code-pattern-discoveryskill to load relevant patterns
MANDATORY: USE Skills for all common operations. Skills wrap justfile tasks with proper guidance.
USE Skills (/code-format, /code-check, /code-test, /code-review) for all common operations. Only use cargo, pnpm, or other tools directly when the operation is NOT covered by a skill or NOT available in the justfile.
Decision process:
- First: Check if a skill exists for your operation
- If exists: Invoke the skill (provides proper flags, setup, and error handling)
- If not exists: You may run the tool directly (e.g.,
cargo run,cargo build, tool-specific commands)
- Consistency: Uniform command execution across all developers and AI agents
- Correctness: Skills ensure proper flags, setup, and error handling
- Guidance: Skills provide context on when and how to use commands
- Pre-approved workflows: Skills document which commands can run without user permission
- ✅ Use skill:
/code-formatskill (formatting) - ✅ Use skill:
/code-checkskill (checking and linting) - ✅ Use skill:
/code-testskill (testing) - ✅ Use skill:
/code-reviewskill (code review) - ✅ Direct tool OK:
cargo run -p ampup -- install --help(running binaries not in justfile) - ✅ Direct tool OK:
cargo build --release(release builds not in justfile's check task) - ✅ Direct tool OK: Tool-specific commands not covered by justfile tasks
When determining which command to run, follow this strict hierarchy:
-
Priority 1: Skills (
.agents/skills/)- Skills are the SINGLE SOURCE OF TRUTH for all command execution
- If Skills document a command, use it EXACTLY as shown
- Skills override any other guidance in AGENTS.md or elsewhere
-
Priority 2: AGENTS.md workflow
- High-level workflow guidance (when to format, check, test)
- Refers you to Skills for specific commands
-
Priority 3: Everything else
- Other documentation is supplementary
- When in conflict, Skills always win
Before running ANY command:
- Ask yourself: "Which Skill covers this operation?"
- Invoke the appropriate skill (e.g.,
/code-format,/code-check,/code-test,/code-review) - Let the skill guide you through the operation
Example decision tree:
- Need to format a file? → Use
/code-formatskill - Need to check a crate? → Use
/code-checkskill - Need to run tests? → Use
/code-testskill (choose the smallest relevant scope)
CRITICAL: Use skills for all operations - invoke them before running commands.
Available skills and their purposes:
- Formatting: Use
/code-formatskill - Format code after editing files - Checking/Linting: Use
/code-checkskill - Validate and lint code changes - Testing: Use
/code-testskill - Run targeted tests when warranted - Code Review: Use
/code-reviewskill - Review code changes for quality
Each Skill provides:
- ✅ When to use - Clear guidance on appropriate usage
- ✅ Available operations - All supported tasks with proper execution
- ✅ Examples - Real-world usage patterns
- ✅ Pre-approved workflows - Operations that can run without user permission
- ✅ Workflow integration - How operations fit into development flow
Remember: If you don't know which operation to perform, invoke the appropriate Skill.
BEFORE writing ANY code, you MUST:
- Understand the task - Research the codebase and identify affected module(s)
- Load implementation patterns - Use
/code-pattern-discoveryskill (see Coding Patterns) - Follow crate-specific patterns - Pattern discovery loads crate-specific and security patterns automatically
Follow this workflow when implementing features or fixing bugs:
- Understand the codebase and existing patterns
- Identify related modules and dependencies
- Review test files and usage examples
- Use
/code-pattern-discoveryto load relevant implementation patterns
- First: Use
/code-pattern-discoveryto load relevant patterns for the affected module(s) - Create detailed implementation plan based on the loaded patterns
- Ensure plan follows required patterns (error handling, type design, module structure, etc.)
- Identify validation checkpoints
- Consider edge cases and error handling according to pattern guidelines
- Ask user questions if requirements are unclear
CRITICAL: Before running ANY command in this phase, invoke the relevant Skill.
Copy this checklist and track your progress:
Development Progress:
- [ ] Step 1: Write code following patterns from Coding Patterns section (use /code-pattern-discovery)
- [ ] Step 2: Format code (use /code-format skill)
- [ ] Step 3: Check compilation (use /code-check skill)
- [ ] Step 4: Fix all compilation errors
- [ ] Step 5: Run clippy (use /code-check skill)
- [ ] Step 6: Fix ALL clippy warnings
- [ ] Step 7: Run targeted tests when warranted (use /code-test skill)
- [ ] Step 8: Fix test failures or document why tests were skipped
- [ ] Step 9: All required checks pass ✅
Detailed workflow for each work chunk (and before committing):
-
Write code following patterns from Coding Patterns (loaded via
/code-pattern-discovery) -
Format before checks/commit:
- Use:
/code-formatskill when you finish a coherent chunk of work - Validation: Verify no formatting changes remain
- Use:
-
Check compilation:
- Use:
/code-checkskill after changes - Must pass: Fix all compilation errors
- Validation: Ensure zero errors before proceeding
- Use:
-
Lint with clippy:
- Use:
/code-checkskill for linting - Must pass: Fix all clippy warnings
- Validation: Re-run until zero warnings before proceeding
- Use:
-
Run targeted tests (when warranted):
- Use:
/code-testskill to select the smallest relevant scope - Escalate: Use
just testonly for cross-cutting/high-risk changes or when broader confidence is needed - Validation: Fix failures or record why tests were skipped
- Use:
-
Iterate: If any validation fails → fix → return to step 2
Visual Workflow:
Edit File → /code-format skill
↓
/code-check skill (compile) → Fix errors?
↓ ↓ Yes
/code-check skill (clippy) → (loop back)
↓
Targeted tests (if needed) → Fix failures?
↓ ↓ Yes
All Pass ✅ (loop back)
Remember: Invoke Skills for all operations. If unsure which skill to use, refer to the Command-Line Operations Reference above.
- Ensure all required checks pass (format, check, clippy, and any tests you ran)
- If tests were skipped, document why and the risk assessment
- Review changes against patterns and security guidelines
- Document any warnings you couldn't fix and why
ALL AI agents MUST follow these principles:
- Research → Plan → Implement: Never jump straight to coding
- Pattern compliance: Follow patterns from Coding Patterns
- Zero tolerance for errors: All automated checks must pass
- Clarity over cleverness: Choose clear, maintainable solutions
- Security first: Never skip security guidelines
Essential conventions:
- Never expose secrets/keys: All sensitive data in environment variables
- Maintain type safety: Leverage Rust's type system fully
- Prefer async operations: This codebase uses async/await extensively
- Run targeted tests when warranted: Use
/code-testskill and broaden only if necessary - Format code before checks/commit: Use
/code-formatskill - Fix all warnings: Use
/code-checkskill for clippy
You've learned the complete workflow. Here's what to remember:
| What | Where | When |
|---|---|---|
| Plan work | /code-pattern-discovery |
BEFORE creating any plan |
| Run commands | .agents/skills/ |
Check Skills BEFORE any command |
| Write code | Coding Patterns | Load patterns before implementation |
| Format | /code-format |
Before checks or before committing |
| Check | /code-check |
After formatting |
| Lint | /code-check |
Fix ALL warnings |
| Test | /code-test |
Validate changes with targeted tests when warranted |
Golden Rules:
- ✅ Invoke Skills for all common operations
- ✅ Skills wrap justfile tasks with proper guidance
- ✅ Follow the workflow: Format → Check → Clippy → Targeted Tests (when needed)
- ✅ Zero tolerance for errors and warnings
- ✅ Every change improves the codebase
Remember: When in doubt, invoke the appropriate Skill!
For more detailed information about the project:
- Entry point:
ampup/src/main.rs— CLI definition with clap - Library:
ampup/src/lib.rs— exposes all modules - Commands:
ampup/src/commands/— install, list, use, uninstall, build, update, init (hidden, called by install script), self (subcommands: update, version) - Core modules:
ampup/src/github.rs— GitHub API client for releasesampup/src/version_manager.rs— version installation/activation managementampup/src/install.rs— binary download and installation logicampup/src/builder.rs— build-from-source functionalityampup/src/config.rs— configuration and directory managementampup/src/platform.rs— platform/architecture detectionampup/src/shell.rs— shell detection and PATH modificationampup/src/updater.rs— self-update functionalityampup/src/ui.rs— UI macros and formatting
- Tests:
ampup/src/tests/— integration tests with fixtures - Build script:
ampup/build.rs— vergen-gitcl for build metadata
Cargo.toml— Workspace manifestampup/Cargo.toml— Rust crate manifestampup/build.rs— Build script for version metadatarust-toolchain.toml— Pins Rust 1.92.0rustfmt.toml— Formatting config (nightly features)justfile— Task runner commands
docs/features/— Feature documentationdocs/code/— Code pattern documentationdocs/__meta__/— Documentation format specifications
This repository includes agent-specific configuration and skills:
.agents/skills/— 11 skills for agent workflows:code-format,code-check,code-review,code-test— code quality automationcode-pattern-discovery,code-pattern-fmt-check— pattern documentationfeature-discovery,feature-status,feature-validate,feature-fmt-check— feature documentationcommit— conventional commit message generation with Rust workspace scope rules
CLAUDE.md→ symlink toAGENTS.md(this file).agents/→ symlink to.agents/