Skip to content

Commit c0a9f54

Browse files
docs: restructure documentation for AI agent optimization (#612)
* docs: restructure documentation for AI agent optimization - Organized documentation into guidance, requirements, specifications, and development directories - Separated corporate steering from project-level technical architecture - Moved high-level goals into a new PRD (launchpad-prd.md) - Updated README.md to reflect the new structure - Removed obsolete top-level docs/*.md files Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
1 parent bd4b6bc commit c0a9f54

File tree

13 files changed

+297
-189
lines changed

13 files changed

+297
-189
lines changed

AI_AGENTS.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# AI Agent Guidelines for Mirantis Launchpad
2+
3+
This document defines guidelines for AI agents working on the Launchpad project. These instructions take precedence over general tool defaults.
4+
5+
---
6+
7+
## Core Principles
8+
9+
1. **Generalization**: Support all AI agents, not just specific providers.
10+
2. **Consistency**: Follow Launchpad’s architectural patterns and conventions.
11+
3. **Clarity**: Document decisions and reasoning for human reviewers.
12+
13+
---
14+
15+
## Documentation Structure
16+
17+
Documentation is organized to minimize context overhead for agents:
18+
- `docs/guidance/`: Foundational principles and project vision.
19+
- `docs/requirements/`: High-level product requirements (PRDs).
20+
- `docs/specifications/`: Technical specifications, architecture, and design.
21+
- `docs/development/`: Development workflows, building, and testing.
22+
- `docs/usage/`: User-facing documentation.
23+
24+
---
25+
26+
## Agent Workflow
27+
28+
### 1. Research Phase
29+
- Read `docs/guidance/project.md` to understand core architectural principles.
30+
- For feature requests, review the relevant PRD in `docs/requirements/`.
31+
- For bug fixes, review the relevant specification in `docs/specifications/`.
32+
33+
### 2. Strategy Phase
34+
- Propose changes that align with the **Phase Manager** architecture (`docs/specifications/architecture.md`).
35+
- Ensure changes are backwards compatible or include migrations (`docs/specifications/architecture.md`).
36+
- Document trade-offs and decisions in the PR description.
37+
38+
### 3. Execution Phase
39+
- All commits MUST be signed.
40+
- Follow the testing strategy outlined in `docs/development/workflow.md`.
41+
- Use `make local` for rapid iteration and validation.
42+
43+
---
44+
45+
## Technical Constraints
46+
47+
- **Language**: Go (Golang).
48+
- **Core Library**: [k0sproject Rig](https://github.com/k0sproject/rig) for host management.
49+
- **Build System**: Goreleaser (invoked via `Makefile`).
50+
- **Telemetry**: Maintain existing telemetry patterns for installation, upgrades, and errors.
51+
- **State**: Launchpad is stateless between runs; use phases for discovery.

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
# Mirantis Launchpad CLI Tool
22

3-
The Mirantis custom binary cli tool to assist installing, upgrading and resetting MKE3 & MCR clusters on provisioned compute node resources. Launchpad provides advantages over manually installing MCR and MKE3 in it automates the process without limiting how the underlying cluster is provisioned or managed. The tool is a golang cli written leveraging the k0sproject rig library for managing compute nodes/machines.
3+
The Mirantis Launchpad CLI tool automates the installation, upgrading, and resetting of MKE (Mirantis Kubernetes Engine) and MCR (Mirantis Container Runtime) clusters on provisioned compute node resources.
44

5-
Launchpad is an open source tool, steered by Mirantis.
5+
## Documentation Index
66

7-
Launchpad was open sourced in early 2025, during which time development moved from an internal process to a GitHub based bublic process. Older pull requests include internal ticket numbers for reference.
7+
Documentation is organized to provide clear, context-efficient guidance for both users and AI agents:
88

9-
## Development
9+
- **[AI Agent Mandates](GEMINI.md)**: Foundational instructions for AI agents working in this repository.
10+
- **[Requirements (PRDs)](docs/requirements/launchpad-prd.md)**: High-level objectives and product requirements.
11+
- **[Corporate Guidance](docs/guidance/corporate.md)**: Steering and contribution principles from Mirantis.
12+
- **[Project Guidance](docs/guidance/project.md)**: Core architectural principles and technical frameworks.
13+
- **[Technical Specification](docs/specifications/architecture.md)**: Details on the Phase Manager and internal components.
14+
- **[Development Workflow](docs/development/workflow.md)**: Building, testing, and contribution rules.
15+
- **[User Guide](docs/usage/getting-started.md)**: Installation, provisioning, and running instructions.
1016

11-
Issues are reported as Github issues. Feature requests can also be submitted as Issues.
17+
## Quick Start
1218

13-
Pull requests are accepted, but it is requested that contributors first read through the [developer's guide](docs/developer.md)
19+
1. **Download**: Get the latest binary from [GitHub Releases](https://github.com/Mirantis/launchpad/releases).
20+
2. **Provision**: Set up your compute nodes (optionally using [Mirantis Terraform helpers](docs/usage/getting-started.md#terraform-helpers)).
21+
3. **Configure**: Create a `launchpad.yaml`.
22+
4. **Execute**: Run `launchpad apply`.
1423

15-
Steering is heavily guided by Mirantis, mainly in order to avoid breaking changes, and to avoid adding complexity that serves only rare use-cases.
24+
For detailed usage, refer to the [public documentation](https://docs.mirantis.com/mke/3.8/launchpad.html).
1625

17-
## Usage
26+
## Contributing
1827

19-
Launchpad is installed pulling directly from the Launchpad GitHub releases. Before executing, clusters need to be provisioned and a configuration file needs to be provided.
28+
We welcome contributions! Please read our [Contribution Rules](docs/guidance/corporate.md#contribution-rules-signed-commits-required) and [Development Workflow](docs/development/workflow.md) before submitting a pull request.
2029

21-
Users can get oriented using the [usage guide](docs/usage.md) but should read the [public documentation](https://docs.mirantis.com/mke/3.8/launchpad.html) for real usage.
30+
**All commits MUST be signed.**

docs/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/design.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

docs/developer.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/development/workflow.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Development Workflow: Mirantis Launchpad
2+
3+
This guide covers building, testing, and contributing to the Launchpad codebase.
4+
5+
## Building Locally
6+
7+
Launchpad uses `goreleaser` for production builds, but provides a `Makefile` for local development.
8+
9+
- **`make local`**: Builds a single, platform-specific binary for rapid testing.
10+
- **`make build-release`**: Performs a full production build, requiring a clean repository and release tag.
11+
- **`make sign-release`**: Signs the Windows binary (requires specific environment variables).
12+
13+
## Testing Strategy
14+
15+
Launchpad's system-centric nature requires a layered testing approach:
16+
17+
### 1. Unit and Functional Tests (`pkg/`, `test/functional/`)
18+
- **Unit**: Small tests for individual functions or components.
19+
- **Functional**: Tests that verify specific functional components.
20+
- **Run**: `go test ./pkg/...` and `go test ./test/functional/...`.
21+
22+
### 2. Integration Tests (`test/integration/`)
23+
- **Focus**: Verifies functional elements on actual clusters provisioned by the test suite.
24+
- **Run**: `go test ./test/integration/...`.
25+
26+
### 3. Smoke Tests (`test/smoke/`)
27+
- **Focus**: End-to-end command testing (`apply`, `reset`, etc.) using a real compute cluster.
28+
- **Smoke Small**: Provision a small number of machines.
29+
- **Smoke Large**: Provision a large and varied cluster.
30+
- **Run**: `go test ./test/smoke/...`.
31+
32+
## Contributing Principles
33+
34+
- **Signed Commits**: All commits must be signed using `git commit -s`.
35+
- **Feature Options**: Make new features optional via configuration or command flags.
36+
- **Phase Integration**: Implement new functionality as phases whenever possible for reusability.
37+
- **Schema Safety**: Avoid changes to the configuration syntax. If a change is necessary:
38+
- Bump the version.
39+
- Include an in-memory migration in `pkg/config/migration/`.
40+
- **Linting**: Ensure all changes pass `golangci-lint`.

docs/guidance/corporate.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Mirantis Corporate Guidance for Launchpad
2+
3+
Launchpad is an open-source tool steered by Mirantis to provide a seamless installation experience for MKE and MCR clusters.
4+
5+
## Steering Principles
6+
7+
- **Avoid Breaking Changes**: Backward compatibility is a primary concern. Any changes to the configuration schema must include a migration strategy.
8+
- **Maintain Focus**: Avoid adding complexity that serves only niche or rare use-cases.
9+
- **Consistency**: The tool must align with Mirantis product standards and existing ecosystem tools like `testkit`.
10+
11+
## Contribution Rules (Signed Commits Required)
12+
13+
- **Issues**: All changes should have a corresponding GitHub issue for high-level discussion before implementation.
14+
- **Pull Requests**:
15+
- Maintain a 1-to-1 relationship between PRs and issues whenever possible.
16+
- Commits MUST be signed (use `git commit -s`).
17+
- PRs must be rebased off of the `main` branch.
18+
- Changes must pass all `golangci-lint` checks.
19+
- **Contact**: Ping `@james-nesbitt` on GitHub for feedback if it is not received in a timely manner.

docs/guidance/project.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Launchpad Project Guidance
2+
3+
Launchpad is a Go-based CLI tool designed for installing, upgrading, and resetting MKE and MCR clusters.
4+
5+
## Core Architectural Principles
6+
7+
- **Infrastructure Agnostic**: The tool must work on any infrastructure (on-prem, public cloud, private cloud, hybrid, bare-metal).
8+
- **No Mandatory External Dependencies**: Do not require pre-installed tools on cluster machines.
9+
- **Built-in Telemetry**: Always include telemetry for installation and upgrade phases, including error reporting.
10+
- **Diagnostic-Focused**: Provide meaningful output for diagnostics (e.g., `error.log`, `install.log`).
11+
- **Statelessness**: Launchpad does not maintain persistent state between runs. Use discovery phases to determine cluster state at runtime.
12+
13+
## Technical Framework
14+
15+
- **Go (Golang)**: The primary language for the CLI and its core components.
16+
- **k0sproject Rig**: Used for managing compute nodes/machines over SSH or WinRM.
17+
- **Phase Manager**: All operations (install, upgrade, reset) are organized into reusable **Phases** that can be conditionally executed.
18+
- **Configuration Migrations**: Maintain backward compatibility by providing in-memory migrations for older configuration formats.

0 commit comments

Comments
 (0)