Skip to content

Commit e923004

Browse files
committed
feat(ampup): spin off version manager from edgeandnode/amp
Establish ampup as a standalone repository extracted from the amp monorepo. - Add `ampup` crate with install, list, use, uninstall, build, and update commands - Configure CI workflows, pre-commit hooks, and Renovate for automated maintenance - Include coding pattern and feature documentation with agent skill definitions - Add platform installer script and project tooling (justfile, rustfmt, editorconfig) Signed-off-by: Lorenzo Delgado <lorenzo@edgeandnode.com>
0 parents  commit e923004

73 files changed

Lines changed: 15780 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/settings.local.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)",
5+
"Bash(just fmt-file:*)",
6+
"Bash(just fmt-rs:*)",
7+
"Bash(just check:*)",
8+
"Bash(just check-rs:*)",
9+
"Bash(just check-crate:*)",
10+
"Bash(just clippy:*)",
11+
"Bash(just clippy-crate:*)",
12+
"Bash(just test-local:*)",
13+
"Bash(just test-crate:*)",
14+
"Skill(research-github-project)",
15+
"Bash(test:*)",
16+
"Bash(just --list:*)",
17+
"Bash(grep:*)",
18+
"Bash(just build --help:*)",
19+
"Bash(just check-sh:*)",
20+
"Bash(just fmt-sh:*)",
21+
"Bash(just fmt-sh-check:*)"
22+
]
23+
}
24+
}

.agents/skills/code-check/SKILL.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
name: code-check
3+
description: Validate and lint code after changes. Use after editing Rust/shell script files, when user mentions compilation errors, linting, clippy warnings, shellcheck issues, or before commits/PRs. Ensures all code passes checks and has zero warnings.
4+
---
5+
6+
# Code Checking Skill
7+
8+
This skill provides code validation and linting operations for the project codebase, which is a single-crate Rust workspace.
9+
10+
## When to Use This Skill
11+
12+
Use this skill when you need to:
13+
- Validate Rust or shell script code after making changes
14+
- Run compiler checks without building
15+
- Lint code with clippy (Rust) or shellcheck (shell scripts)
16+
- Ensure code quality before commits or PRs
17+
18+
## Available Commands
19+
20+
### Check Rust Code
21+
```bash
22+
just check-rs [EXTRA_FLAGS]
23+
```
24+
Checks Rust code using `cargo check --all-targets`. This runs the compiler without producing binaries.
25+
26+
**Alias**: `just check` (same as `check-rs`)
27+
28+
Examples:
29+
- `just check-rs` - check all Rust code
30+
- `just check-rs --release` - check with release optimizations
31+
32+
### Lint Rust Code (Clippy)
33+
```bash
34+
just clippy [EXTRA_FLAGS]
35+
```
36+
Lints all Rust code using `cargo clippy --all-targets`. Clippy catches common mistakes and suggests improvements.
37+
38+
Examples:
39+
- `just clippy` - lint all code
40+
- `just clippy -- -D warnings` - treat warnings as errors
41+
42+
### Check Shell Scripts
43+
```bash
44+
just check-sh
45+
```
46+
Lints shell scripts. Currently checks the `install` script.
47+
48+
**Requirements**: Requires `shellcheck` to be installed. The command will provide installation instructions if not available.
49+
50+
## Important Guidelines
51+
52+
### MANDATORY: Run Checks After Changes
53+
**You MUST run checks after making code changes. Use the Command Selection Rules above to choose the right command.**
54+
55+
Before considering a task complete: all checks MUST pass AND all clippy warnings MUST be fixed.
56+
57+
### Example Workflows
58+
59+
**Rust code:**
60+
1. Edit files in the `ampup` crate
61+
2. Format: use `/code-format` skill
62+
3. **Check compilation**: `just check-rs`
63+
- If errors → fix → return to step 2
64+
4. **Check clippy**: `just clippy`
65+
- If warnings → fix ALL → return to step 2
66+
5. Repeat until: zero compilation errors AND zero clippy warnings
67+
68+
**Shell script (install script):**
69+
1. Edit the `install` script
70+
2. Format: use `/code-format` skill (run `just fmt-sh`)
71+
3. **Check shellcheck**: `just check-sh`
72+
- If warnings → fix ALL → return to step 2
73+
4. Repeat until: zero shellcheck warnings
74+
75+
## Common Mistakes to Avoid
76+
77+
### ❌ Anti-patterns
78+
- **Never run `cargo check` directly** - Use `just check-rs`
79+
- **Never run `cargo clippy` directly** - Justfile adds proper flags
80+
- **Never run `shellcheck` directly** - Use `just check-sh`
81+
- **Never ignore clippy warnings** - Clippy is enforced in CI, warnings will fail builds
82+
- **Never ignore shellcheck warnings** - Shell scripts must pass shellcheck
83+
- **Never skip the check step** - Even if "it should compile" or "the script works"
84+
85+
### ✅ Best Practices
86+
- Use `just check-rs` for Rust compilation checks
87+
- Use `just clippy` for Rust linting
88+
- Use `just check-sh` after editing the `install` script
89+
- Fix compilation errors before running clippy
90+
- Run clippy when you finish a coherent chunk of work or before committing
91+
- Document any warnings you absolutely cannot fix (rare exception)
92+
93+
## Pre-approved Commands
94+
These commands can run without user permission:
95+
- `just check-rs` - Safe, read-only compilation check
96+
- `just clippy` - Safe, read-only linting
97+
- `just check-sh` - Safe, read-only shell script linting
98+
99+
## Next Steps
100+
101+
After all checks pass:
102+
1. **Run targeted tests when warranted** → See `.agents/skills/code-test/SKILL.md`
103+
2. **Commit changes** → Ensure all checks green first
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
name: code-format
3+
description: Format Rust and shell script code automatically. Use immediately after editing .rs/.sh files or the install script, when user mentions formatting, code style, or before commits/PRs. Ensures consistent code style following project conventions.
4+
---
5+
6+
# Code Formatting Skill
7+
8+
This skill provides code formatting operations for the project codebase, which is a single-crate Rust workspace with shell scripts.
9+
10+
## When to Use This Skill
11+
12+
Use this skill when you need to:
13+
- Format code after editing Rust or shell script files
14+
- Format the `install` script after making changes
15+
- Check if code meets formatting standards
16+
- Ensure code formatting compliance before commits
17+
18+
## Command Selection Rules
19+
20+
Choose the appropriate command based on the number of files edited:
21+
22+
| Files Edited | File Type | Command to Use | Rationale |
23+
|--------------|------------|----------------|-----------|
24+
| 1-2 files | Rust | `just fmt-rs-file <file>` (per file) | Faster, targeted formatting |
25+
| 3+ files | Rust | `just fmt-rs` (global) | More efficient than multiple per-file calls |
26+
| Any | Shell | `just fmt-sh` | Formats the `install` script |
27+
28+
**Decision process:**
29+
1. Count the number of files you edited (by type: Rust or Shell)
30+
2. If 2 or fewer Rust files: run `just fmt-rs-file` for each file
31+
3. If 3 or more Rust files: run the global command `just fmt-rs`
32+
4. For shell scripts: always run `just fmt-sh` (currently only formats the `install` script)
33+
34+
## Available Commands
35+
36+
### Format Rust Code
37+
```bash
38+
just fmt-rs
39+
```
40+
Formats all Rust code using `cargo +nightly fmt --all`. This is the primary formatting command.
41+
42+
**Alias**: `just fmt` (same as `fmt-rs`)
43+
44+
### Check Rust Formatting
45+
```bash
46+
just fmt-rs-check
47+
```
48+
Checks Rust code formatting without making changes using `cargo +nightly fmt --all -- --check`.
49+
50+
**Alias**: `just fmt-check` (same as `fmt-rs-check`)
51+
52+
### Format Specific Rust File
53+
```bash
54+
just fmt-rs-file <FILE>
55+
```
56+
Formats a specific Rust file using `cargo +nightly fmt`.
57+
58+
Examples:
59+
- `just fmt-rs-file ampup/src/main.rs` - formats a Rust file
60+
- `just fmt-rs-file ampup/src/config.rs` - formats another Rust file
61+
62+
### Format Shell Scripts
63+
```bash
64+
just fmt-sh
65+
```
66+
Formats shell scripts. Currently formats the `install` script.
67+
68+
**Requirements**: Requires `shfmt` to be installed. The command will provide installation instructions if not available.
69+
70+
### Check Shell Script Formatting
71+
```bash
72+
just fmt-sh-check
73+
```
74+
Checks shell script formatting without making changes.
75+
76+
## Important Guidelines
77+
78+
### Format Before Checks/Commit
79+
Format code when you finish a coherent chunk of work and before running checks or committing.
80+
81+
This is a critical requirement from the project's development workflow:
82+
- Do not skip formatting before checks/commit
83+
- Use the Command Selection Rules above to choose the right command
84+
- Run formatting before any check or test commands
85+
86+
### Example Workflows
87+
88+
**Single file edit:**
89+
1. Edit a Rust file: `ampup/src/config.rs`
90+
2. When ready to validate, run: `just fmt-rs-file ampup/src/config.rs`
91+
3. Then run checks
92+
93+
**Multiple files edit (3+):**
94+
1. Edit multiple Rust files across the codebase
95+
2. When ready to validate, run: `just fmt-rs`
96+
3. Then run checks
97+
98+
**Shell script edit:**
99+
1. Edit the `install` script
100+
2. When ready to validate, run: `just fmt-sh`
101+
3. Then run checks
102+
103+
## Common Mistakes to Avoid
104+
105+
### ❌ Anti-patterns
106+
- **Never run `cargo fmt` directly** - Use `just fmt-rs-file` or `just fmt-rs`
107+
- **Never run `rustfmt` directly** - The justfile includes proper flags
108+
- **Never run `shfmt` directly** - Use `just fmt-sh`
109+
- **Never skip formatting before checks/commit** - Even "minor" edits need formatting
110+
- **Never use `just fmt-rs` for 1-2 files** - Use `just fmt-rs-file <file>` for efficiency
111+
- **Never use `just fmt-rs-file` for 3+ files** - Use `just fmt-rs` for efficiency
112+
113+
### ✅ Best Practices
114+
- Format before running checks/tests or before committing
115+
- Use `just fmt-rs-file` for 1-2 files (faster, targeted)
116+
- Use `just fmt-rs` for 3+ files (more efficient)
117+
- Use `just fmt-sh` after editing the `install` script
118+
- Run format check commands to verify formatting before commits
119+
120+
## Next Steps
121+
122+
After formatting your code:
123+
1. **Check compilation** → See `.agents/skills/code-check/SKILL.md`
124+
2. **Run clippy** → See `.agents/skills/code-check/SKILL.md`
125+
3. **Run targeted tests when warranted** → See `.agents/skills/code-test/SKILL.md`

0 commit comments

Comments
 (0)