Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
discovery and implementation in private modules under `src/`.
- Keep task names under `agent:context` and link this crate from the private `bake/` executable.
- Keep package usage, provider instructions, and the language-agnostic specification in `context/`.
- Keep release notes and license updates composed through the local `cargo:after_version_bump` task.
- Keep release notes and license updates composed through the shared `socketry-project` `cargo:after_version_bump` hook.
- The `bake/` package is private; publish only `bake-agent-context`.
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@ jobs:
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Run tests and require complete source-region coverage
run: cargo bake --locked test:coverage --all-targets true

test-result:
if: always()
needs: [test, quality]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require successful tests and coverage
env:
JOB_RESULTS: ${{ toJSON(needs) }}
run: |
echo "$JOB_RESULTS" | jq -e 'all(.[]; .result == "success")'
35 changes: 28 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bake-agent-context"
version = "0.3.1"
version = "0.3.2"
edition = "2024"
license = "MIT"
repository = "https://github.com/socketry/bake-agent-context-rust"
Expand Down
6 changes: 3 additions & 3 deletions bake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2024"
publish = false

[dependencies]
socketry-project = ">=0.3.3"
bake = "0"
bake-agent-context = { version = "0.3.1", path = ".." }
socketry-project = ">=0.3.7"
bake = "0.19"
bake-agent-context = { version = "0.3.2", path = ".." }
bake-cargo = { version = "0.4.0" }
bake-license = { version = "0.2.0" }
bake-releases = { version = "0.3.0" }
Expand Down
57 changes: 12 additions & 45 deletions context/agent-context.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,23 @@
# Agent Context

Keep reusable package guidance separate from repository-only instructions,
and make both easy for agents to discover.
Keep reusable package guidance separate from repository-only instructions, and make both easy for agents to discover.

## Package guidance

Put guidance that benefits users of a crate in its tracked `context/`
directory. Explain package-specific architecture, important invariants, common
usage patterns, and decisions that are not obvious from the public API. Keep
each guide focused on one topic, use descriptive lowercase filenames, and link
related guides together.

Include `context/**` in the published Cargo package when downstream users need
the guidance. Bake Agent Context builds `.agents/context/index.md` from each
installed document's first heading and first prose sentence. It does not create
or modify the repository owner's `agents.md`. Use the `bake-agent-context-usage`
skill for file format, skill metadata, and installation details.

Use a skill for a task-oriented procedure that an agent should follow, such as
setting up a repository or preparing a pull request. Skills are source Markdown
files in `context/` with YAML front matter containing `type: skill` and a
description. Bake installs them under `.agents/skills/` with names prefixed by
the provider crate. Skill documents are not copied to `.agents/context/` or
listed in the generated context index.
Put guidance that benefits users of a crate in its tracked `context/` directory. Explain package-specific architecture, important invariants, common usage patterns, and decisions that are not obvious from the public API. Keep each guide focused on one topic, use descriptive lowercase filenames, and link related guides together.

Include `context/**` in the published Cargo package when downstream users need the guidance. Bake Agent Context builds `.agents/context/index.md` from each installed document's first heading and first prose sentence. It does not create or modify the repository owner's `agents.md`. Use the `bake-agent-context-usage` skill for file format, skill metadata, and installation details.

Use a skill for a task-oriented procedure that an agent should follow, such as setting up a repository or preparing a pull request. Skills are source Markdown files in `context/` with YAML front matter containing `type: skill` and a description. Bake installs them under `.agents/skills/` with names prefixed by the provider crate. Skill documents are not copied to `.agents/context/` or listed in the generated context index.

## Repository-only instructions

Put guidance that applies only to the current checkout in `.agents/`. This can
include local development instructions, project-specific skills, and
instructions that should not ship to crate users. Do not put credentials or
machine-specific private details in package context.

The repository owner controls `agents.md`; context installation leaves it
untouched. If agents should use dependency guidance, add a stable link to
`.agents/context/index.md` there. `cargo bake agent:context:install` maintains
a marked block in the local Git exclude file (`.git/info/exclude`) for
generated `.agents/context/` files, the skill ownership registry, and each
dependency-installed skill directory. These rules stay in the local checkout
instead of becoming project files. Project-owned skill directories remain
trackable. Edit package skill sources under `context/` and repository-only
skills under `.agents/skills/`, not generated dependency copies.
Put guidance that applies only to the current checkout in `.agents/`. This can include local development instructions, project-specific skills, and instructions that should not ship to crate users. Do not put credentials or machine-specific private details in package context.

The repository owner controls `agents.md`; context installation leaves it untouched. If agents should use dependency guidance, add a stable link to `.agents/context/index.md` there. `cargo bake agent:context:install` maintains a marked block in the local Git exclude file (`.git/info/exclude`) for generated `.agents/context/` files, the skill ownership registry, and each dependency-installed skill directory. These rules stay in the local checkout instead of becoming project files. Project-owned skill directories remain trackable. Edit package skill sources under `context/` and repository-only skills under `.agents/skills/`, not generated dependency copies.

## Install and update

Add `bake-agent-context` to the project's private `bake/` package, directly or
through a shared task package such as `socketry-project`. Run
`cargo bake agent:context:install` to install ordinary context and skills from
resolved dependencies and update `.agents/context/index.md`. Run it again after
changing a context-providing dependency. Use `--package CRATE` to install from
one provider, or the skill-specific tasks to list and install selected skills.

Before changing a project, follow its `agents.md` instructions, read relevant
installed context from `.agents/context/index.md`, and apply any skills that
fit the work. For details about the available Bake tasks and their options,
use the `bake-agent-context-usage` skill.
Add `bake-agent-context` to the project's private `bake/` package, directly or through a shared task package such as `socketry-project`. Run `cargo bake agent:context:install` to install ordinary context and skills from resolved dependencies and update `.agents/context/index.md`. Run it again after changing a context-providing dependency. Use `--package CRATE` to install from one provider, or the skill-specific tasks to list and install selected skills.

Before changing a project, follow its `agents.md` instructions, read relevant installed context from `.agents/context/index.md`, and apply any skills that fit the work. For details about the available Bake tasks and their options, use the `bake-agent-context-usage` skill.
4 changes: 2 additions & 2 deletions context/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Bake tasks belong in your project's private `bake/` crate. Add the Bake task lib

```toml
[dependencies]
bake = "0.17"
bake-agent-context = "0.1"
bake = "0.19"
bake-agent-context = "0.3"
```

Link the task library from `bake/src/main.rs` and run the discovered task registry:
Expand Down
Loading
Loading