|
| 1 | +# AGENT.md |
| 2 | + |
| 3 | +This file provides guidance to coding agents when working with code in this |
| 4 | +repository. |
| 5 | + |
| 6 | +## Skills |
| 7 | + |
| 8 | +This repository includes bundled skills for coding agents to use. These skills |
| 9 | +can be found in the `.agents/skills` directory. |
| 10 | + |
| 11 | +Some skills will be manually invoked based on the task at hand, others may need |
| 12 | +to be invoked manually using `/<skill name>`. |
| 13 | + |
| 14 | +| Skill | Description | |
| 15 | +| ------------ | ---------------------------------------------------------------------------------------------------------------------------- | |
| 16 | +| `/tech-spec` | Create a technical specification for a project, feature, or other task. Use when asked to develop a technical specification. | |
| 17 | + |
| 18 | +## Commands |
| 19 | + |
| 20 | +```bash |
| 21 | +bundle exec rake # lint + tests (default) |
| 22 | +bundle exec rake rubocop # lint only |
| 23 | +bundle exec rake spec # all tests |
| 24 | +bundle exec rspec spec/unit/cfa_eng_cli/bastion_spec.rb # single test file |
| 25 | +``` |
| 26 | + |
| 27 | +## Architecture |
| 28 | + |
| 29 | +This is a Ruby CLI gem for Code for America engineering teams, built on [Thor]. |
| 30 | +It manages AWS bastion host connections and named profiles. |
| 31 | + |
| 32 | +### Entry point |
| 33 | + |
| 34 | +- `bin/cfa-eng`: Defines the top-level Thor class and registers two subcommand |
| 35 | + groups. |
| 36 | + |
| 37 | +### Two subcommand groups |
| 38 | + |
| 39 | +- `bastion`: Manages tunnel configurations and opens SSH tunnels via AWS Session |
| 40 | + Manager port forwarding |
| 41 | +- `profile`: Manages named connection profiles stored as YAML in |
| 42 | + `~/.codeforamerica/profiles/` |
| 43 | + |
| 44 | +### Command layer |
| 45 | + |
| 46 | +- `lib/cfa_eng_cli/commands/`: Each group is a Thor subcommand class inheriting |
| 47 | + from `Commands::Command` (`base.rb`); commands delegate to business logic |
| 48 | + classes rather than containing logic themselves. |
| 49 | + |
| 50 | +### Business logic |
| 51 | + |
| 52 | +- `Bastion`: Discovers running EC2 bastion instances by project/environment |
| 53 | + tags, constructs `SessionTarget`, and opens port-forwarding tunnels |
| 54 | +- `SessionManager`: Wraps the AWS SSM `StartSession` API and shells out to the |
| 55 | + `session-manager-plugin` binary to maintain the connection |
| 56 | + |
| 57 | +[thor]: https://github.com/rails/thor |
0 commit comments