Skip to content

Commit 96c867b

Browse files
committed
docs: minimize AGENTS.md, extract skills and agent config
AGENTS.md reduced from 49 to 25 lines using progressive disclosure: - Removed project description (redundant with CONTEXT.md) - Removed project rules (enforced by code structure) - Moved donor policy to .claude/skills/donor-policy.md - Moved command contract checklist to .claude/skills/command-contract.md - Added docs/agents/ for issue tracker, triage labels, and domain docs
1 parent 93907fe commit 96c867b

6 files changed

Lines changed: 120 additions & 22 deletions

File tree

.claude/skills/command-contract.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: command-contract
3+
description: Checklist for CLI contract changes — run when modifying commands, flags, or JSON output
4+
---
5+
6+
# Command Contract Discipline
7+
8+
When changing CLI commands, flags, JSON output structure, or command behavior, verify these are updated:
9+
10+
1. **Command help** — the cobra command's Short/Long/Example text
11+
2. **`docs/PRD.md`** — if product requirements changed
12+
3. **`docs/ARCHITECTURE.md`** — if module boundaries changed
13+
4. **Contract tests** — once the command is stable
14+
15+
This is a checklist, not a blocker. If the change is internal-only (refactor without behavior change), skip.

.claude/skills/donor-policy.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: donor-policy
3+
description: Rules for working with donor/reference repositories in donors/
4+
---
5+
6+
# Donor Policy
7+
8+
Use donor repositories for reference:
9+
10+
- `donors/monarchmoney-cli`: CLI contract and safety design.
11+
- `donors/ray-finance`: provider sync and local data lessons.
12+
- `donors/actual`: local-first budgeting and automation lessons.
13+
- `donors/maybe`: finance product/domain modeling.
14+
15+
## Rules
16+
17+
- Copying code from donors requires checking license compatibility first.
18+
- **Maybe is AGPL** — do not copy code from it unless the project intentionally adopts a compatible license.
19+
- Do not commit `donors/`; it is local reference material only.
20+
- When using donor code as reference, adapt the pattern to this project's types and interfaces rather than copying verbatim.

AGENTS.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
# Agent Instructions
22

3-
遵循奥卡姆剃刀和第一性原理,不写兜底代码,检查代码是否有过时/死代码。
3+
不写兜底代码。检查过时/死代码。遵循奥卡姆剃刀
44

5-
This project is a local-first finance backend for external AI agents. Keep the core boring and deterministic.
5+
## Agent skills
66

7-
## Project Rules
7+
### Issue tracker
88

9-
- Do not embed AI chat, model providers, conversation memory, hosted billing, telemetry, or required web-server behavior in the core.
10-
- Keep provider-specific behavior behind provider adapters.
11-
- Keep JSON contracts stable and tested before expanding command scope.
12-
- Do not silently fall back to old config paths, old provider names, or donor project behavior.
13-
- Do not commit `donors/`; it is local reference material only.
14-
- Prefer small deep modules with simple interfaces over many pass-through wrappers.
9+
GitHub Issues. See `docs/agents/issue-tracker.md`.
1510

16-
## Donor Policy
11+
### Triage labels
1712

18-
Use donor repositories for reference:
13+
needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix. See `docs/agents/triage-labels.md`.
1914

20-
- `donors/monarchmoney-cli`: CLI contract and safety design.
21-
- `donors/ray-finance`: provider sync and local data lessons.
22-
- `donors/actual`: local-first budgeting and automation lessons.
23-
- `donors/maybe`: finance product/domain modeling.
15+
### Domain docs
2416

25-
Copying code from donors requires checking license compatibility first. Maybe is AGPL, so do not copy code from it unless the project intentionally adopts a compatible license.
17+
`CONTEXT.md` + `docs/adr/` at repo root. See `docs/agents/domain.md`.
2618

27-
## Command Contract Discipline
19+
### Donor policy
2820

29-
When changing CLI commands, flags, JSON output structure, or command behavior, update:
21+
See `.claude/skills/donor-policy.md` (load when touching `donors/`).
3022

31-
- Command help.
32-
- `docs/PRD.md` if product requirements change.
33-
- `docs/ARCHITECTURE.md` if module boundaries change.
34-
- Contract tests once the command is stable.
23+
### Command contract
24+
25+
See `.claude/skills/command-contract.md` (load when changing CLI commands or JSON output).

docs/agents/domain.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Domain Docs
2+
3+
How the engineering skills should consume this repo's domain documentation when exploring the codebase.
4+
5+
## Before exploring, read these
6+
7+
- **`CONTEXT.md`** at the repo root, or
8+
- **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
9+
- **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
10+
11+
If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The producer skill (`/grill-with-docs`) creates them lazily when terms or decisions actually get resolved.
12+
13+
## File structure
14+
15+
Single-context repo (this repo):
16+
17+
```
18+
/
19+
├── CONTEXT.md
20+
├── docs/adr/
21+
│ └── (ADRs go here as they are created)
22+
└── src/
23+
```
24+
25+
## Use the glossary's vocabulary
26+
27+
When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
28+
29+
If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/grill-with-docs`).
30+
31+
## Flag ADR conflicts
32+
33+
If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
34+
35+
> _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_

docs/agents/issue-tracker.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Issue tracker: GitHub
2+
3+
Issues and PRDs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
4+
5+
## Conventions
6+
7+
- **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
8+
- **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.
9+
- **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
10+
- **Comment on an issue**: `gh issue comment <number> --body "..."`
11+
- **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
12+
- **Close**: `gh issue close <number> --comment "..."`
13+
14+
Infer the repo from `git remote -v``gh` does this automatically when run inside a clone.
15+
16+
## When a skill says "publish to the issue tracker"
17+
18+
Create a GitHub issue.
19+
20+
## When a skill says "fetch the relevant ticket"
21+
22+
Run `gh issue view <number> --comments`.

docs/agents/triage-labels.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Triage Labels
2+
3+
The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
4+
5+
| Label in mattpocock/skills | Label in our tracker | Meaning |
6+
| -------------------------- | -------------------- | ---------------------------------------- |
7+
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
8+
| `needs-info` | `needs-info` | Waiting on reporter for more information |
9+
| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
10+
| `ready-for-human` | `ready-for-human` | Requires human implementation |
11+
| `wontfix` | `wontfix` | Will not be actioned |
12+
13+
When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
14+
15+
Edit the right-hand column to match whatever vocabulary you actually use.

0 commit comments

Comments
 (0)