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
87 changes: 34 additions & 53 deletions .agents/rules/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,72 @@

## Session Start

- **Always** read `tasks/lessons.md` at the beginning of each session before doing any work
- Apply relevant lessons to the current task
- Read `tasks/lessons.md` before doing any work. Apply relevant lessons.

## Workflow Orchestration
## Workflow

### 1. Plan Node Default
### Planning

- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
- If something goes sideways, STOP and re-plan immediately - don't keep pushing
- Use plan mode for verification steps, not just building
- Write detailed specs upfront to reduce ambiguity
- Enter plan mode for any non-trivial task (3+ steps or architectural decisions). Write plan to `tasks/todo.md`.
- If something goes sideways, STOP and re-plan — don't keep pushing.
- Check in before starting implementation. Mark items complete as you go.

### 2. Subagent Strategy
### Subagents

- Use subagents liberally to keep main context window clean
- Offload research, exploration, and parallel analysis to subagents
- For complex problems, throw more compute at it via subagents
- One tack per subagent for focused execution
- Use subagents liberally for research, exploration, and parallel analysis. One tack per subagent.

### 3. Self-Improvement Loop
### Lessons

- **When to amend** `tasks/lessons.md`: whenever something turns out wrong — user correction, test failure, CI failure, code review feedback, or any other signal that a mistake was made
- **How to amend**: add a bullet with (1) what went wrong, (2) the root cause, (3) a rule that prevents the same mistake
- **Best practice for AI agents**: updating lessons is the primary way to persist learning across sessions; agents lack long-term memory, so `tasks/lessons.md` is the project-specific memory that reduces repeated mistakes
- Write rules for yourself that prevent the same mistake
- Ruthlessly iterate on these lessons until mistake rate drops
- Review lessons at session start for relevant project
- **When**: user correction, test failure, CI failure, code review feedback, or any other mistake signal.
- **How**: add a bullet to `tasks/lessons.md` with (1) what went wrong, (2) root cause, (3) a rule that prevents recurrence.
- This is the primary cross-session memory — ruthlessly iterate until mistake rate drops.

### 4. Verification Before Done
### Verification

- Never mark a task complete without proving it works
- **After every feature/story completion**: Use the `post-feature-qa` skill (`.agents/skills/post-feature-qa/`) — run the QA checklist, ensure tests cover edge cases and implementation aligns with the story, fix gaps before marking done
- Diff behavior between main and your changes when relevant
- Never mark a task complete without proving it works — run tests, check logs, demonstrate correctness.
- After every feature/story: use `post-feature-qa` skill (`.agents/skills/post-feature-qa/`).
- Ask yourself: "Would a staff engineer approve this?"
- Run tests, check logs, demonstrate correctness

### 5. Demand Elegance (Balanced)
### Elegance

- For non-trivial changes: pause and ask "is there a more elegant way?"
- If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
- Skip this for simple, obvious fixes - don't over-engineer
- Challenge your own work before presenting it
- Skip this for simple, obvious fixes — don't over-engineer.

### 6. Autonomous Bug Fixing
### Bug Fixing

- When given a bug report: just fix it. Don't ask for hand-holding
- Point at logs, errors, failing tests - then resolve them
- Zero context switching required from the user
- Go fix failing CI tests without being told how

## Task Management

1. **Plan First**: Write plan to `tasks/todo.md` with checkable items
2. **Verify Plan**: Check in before starting implementation
3. **Track Progress**: Mark items complete as you go
4. **Explain Changes**: High-level summary at each step
5. **Document Results**: Add review section to `tasks/todo.md`
6. **Capture Lessons**: Update `tasks/lessons.md` after corrections — see "When to amend" and "How to amend" in Self-Improvement Loop above
- When given a bug report: just fix it. Find root cause, point at logs/errors, resolve. Zero hand-holding.

## Skills

- **post-feature-qa** (`.agents/skills/post-feature-qa/`) — Apply after every feature or story implementation. Act as senior QA: verify test coverage for all edge cases and story alignment; produce QA report; fix gaps before claiming complete.
- **add-agent-target** (`.agents/skills/add-agent-target/`) — Use when adding support for a new AI agent target. Requires current official-doc research, full import/generate implementation, rich realistic fixtures, complete unit/integration/e2e coverage, docs updates, and final QA.
- **post-feature-qa** — Apply after every feature/story. Senior QA: verify edge-case coverage and story alignment.
- **add-agent-target** — Use when adding a new AI agent target. Covers research, implementation, fixtures, full test coverage, docs.

## Core Principles

- **Simplicity First**: Make every change as simple as possible. Impact minimal code.
- **Simplicity**: Make every change as simple as possible. Only touch what's necessary.
- **No Laziness**: Find root causes. No temporary fixes. Senior developer standards.
- **Minimal Impact**: Changes should only touch what's necessary. Avoid introducing bugs.

## Project-Specific Rules
## Project Rules

- **TDD mandatory**: Write failing tests FIRST, then implement. No exceptions.
- **TDD mandatory**: Write failing tests FIRST, then implement.
- **Max file size**: 200 lines. Split by responsibility if larger.
- **No classes unless stateful**: Prefer pure functions + types.
- **No `any`**: Use `unknown` + narrowing.
- **Config source of truth**: `.agentsmesh/` directory. Generated files are artifacts.
- **Test naming**: `{module}.test.ts` colocated with source. Integration tests in `tests/integration/`.
- **Generated artifact tests must be strict**: For generated file structures, assert exact file paths, exact file counts, and exact referenced wrapper/script sets. Do not use loose checks like "at least one file", broad `some(...)`, or prefix-only path assertions when the full output set is known.
- **Generated artifact tests must be strict**: Assert exact file paths, exact file counts, and exact referenced wrapper/script sets. No loose checks (`some(...)`, prefix-only, "at least one").
- **Commit format**: conventional commits — `feat|fix|test|refactor(scope): message`
- **README must stay current**: Any change to CLI commands, flags, config schema, supported targets, or canonical file formats **must** be reflected in `README.md` before the task is marked complete. Treat the README as part of the API surface.
- **Website docs must stay current**: Any change to CLI commands, flags, config schema, supported targets, canonical file formats, or other user-facing behavior **must** also be reflected in the documentation website (`website/src/content/docs/`). The website is the primary public documentation — treat it with the same rigor as `README.md`.
- **Docs must stay current**: Any change to CLI commands, flags, config schema, supported targets, or canonical file formats **must** be reflected in both `README.md` and the website (`website/src/content/docs/`) before the task is marked complete.
- **Target data single source of truth** — do **not** hardcode target lists or support levels outside this chain:
1. `src/targets/catalog/target-ids.ts` (`TARGET_IDS`) = canonical target ID list. Each target's `capabilities` in `src/targets/<name>/index.ts` = feature support levels.
2. `src/core/matrix/data.ts` (`SUPPORT_MATRIX`) = built dynamically from descriptors. Never hardcode.
3. `website/src/content/docs/reference/supported-tools.mdx` = **single docs page** for per-target support. All other pages link here — no duplicate tables.
4. `README.md` matrix must stay in sync with code capabilities.
5. No hardcoded target counts or enumerations on homepage, CLI overview, or other pages. Use generic language and link to the matrix.
6. Adding/changing a target: update `target-ids.ts` + descriptor → `supported-tools.mdx` → `README.md` matrix. No other docs pages should need changes.
- **Refer to PRD**: `docs/prd-v2-complete.md` for architecture decisions
- **Refer to tasks**: `docs/agentsmesh-ai-first-tasks.md` for current task specs

## AgentsMesh Generation Contract

AgentsMesh is a config sync library for AI coding tools. The only canonical source of truth is the `.agentsmesh` directory at the project root; files emitted into target formats such as `AGENTS.md`, `.claude/`, `.cursor/`, `.junie/`, and similar directories are generated artifacts. When making changes, edit canonical config first, then regenerate and verify the target outputs. Preserve the library's bidirectional contract: import native tool config into canonical form, generate back to target-specific layouts, and keep projected or embedded features round-trippable rather than treating them as plain text exports.
AgentsMesh syncs AI coding tool configuration from a single canonical `.agentsmesh` directory. All target-specific files (`.claude/`, `.cursor/`, `AGENTS.md`, etc.) are generated artifactsedit canonical config first, then regenerate. The import/generate contract is bidirectional and lossless: embedded or projected features round-trip without data loss.
8 changes: 4 additions & 4 deletions .agentsmesh/.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Auto-generated. DO NOT EDIT MANUALLY.
# Tracks the state of all config files for team conflict resolution.

generated_at: 2026-03-30T12:15:20.515Z
generated_at: 2026-03-31T10:01:52.933Z
generated_by: serhii
lib_version: 0.2.9
lib_version: 0.2.10
checksums:
agents/code-debugger.md: sha256:707132841c606f117c83491d53ce101be0117eb50abe2861bcf93bdd45a56daf
agents/code-documenter.md: sha256:faa66b16d2e86578985e817d60e6705ae0e34a716c1f5c29411739a6d659fb96
Expand All @@ -16,11 +16,11 @@ checksums:
commands/commit.md: sha256:3e6dcc5871ad157c36efe19c162b43cdc0d723a8695fb0d45c1f90cc28fa931c
commands/review.md: sha256:ba3053410e7cc3271f41ba329056df07c6ccd2f07e2ed3dda601c56e46a77d54
commands/test.md: sha256:a60932b216ff9eb407c2b38e4459ac4b9606a3aed275f4af84a646eb6c2937e7
hooks.yaml: sha256:1016bf9b001da63776022e928088cc4971a123e79e9bab959f04557acd58e3ee
hooks.yaml: sha256:9b2d2f11f9fe2bb7abd3b9dddc77df9ba9bda292aa5a6109c468b2dbff19ba2c
ignore: sha256:9bd184903aee9e824fcd475e965103a8ef5efe5d5e98b0e7e275fb8017c4fc0e
mcp.json: sha256:4269c04f9edf4142cde79d1e45f25958eaca54489cc19ec078eaba887d296018
permissions.yaml: sha256:9c22c5221457f6c165a5f135448f3f95fedb8c9339cb9f91998d844184501158
rules/_root.md: sha256:e2a08a31514ef65656fe3a35299f9a8a4a95c50f502918807c7faecd2ca62540
rules/_root.md: sha256:59aa3f817487ff1053f0718589c0b075b6f97a17b32435563ca30c9555a499aa
rules/typescript.md: sha256:18f52143dfdd3e219a5c6d6c0feb7283fe74cce99458c46dafcd1c3620ad4fba
skills/add-agent-target/SKILL.md: sha256:53a76c84b87f7735c53ac5f5e584e55122c09728a14406e7088ea93b5b183406
skills/add-agent-target/references/target-addition-checklist.md: sha256:66cd8f5ed4dd21b27e2bf4b34ae749ee301b28a208c83fecffa06748c2d2d61c
Expand Down
11 changes: 6 additions & 5 deletions .agentsmesh/hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PreToolUse:
- matcher: Edit|Write
- matcher: Bash
type: command
command: eslint --fix
command: "echo \"Running: $(jq -r '.tool_input.command' < /dev/stdin)\""
PostToolUse:
- matcher: Read
type: prompt
prompt: Review the file content for any security concerns
- matcher: Edit|Write
type: command
command: "jq -r '.tool_input.file_path' | xargs eslint --fix"

85 changes: 33 additions & 52 deletions .agentsmesh/rules/_root.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,87 +6,68 @@ root: true

## Session Start

- **Always** read `tasks/lessons.md` at the beginning of each session before doing any work
- Apply relevant lessons to the current task
- Read `tasks/lessons.md` before doing any work. Apply relevant lessons.

## Workflow Orchestration
## Workflow

### 1. Plan Node Default
### Planning

- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
- If something goes sideways, STOP and re-plan immediately - don't keep pushing
- Use plan mode for verification steps, not just building
- Write detailed specs upfront to reduce ambiguity
- Enter plan mode for any non-trivial task (3+ steps or architectural decisions). Write plan to `tasks/todo.md`.
- If something goes sideways, STOP and re-plan — don't keep pushing.
- Check in before starting implementation. Mark items complete as you go.

### 2. Subagent Strategy
### Subagents

- Use subagents liberally to keep main context window clean
- Offload research, exploration, and parallel analysis to subagents
- For complex problems, throw more compute at it via subagents
- One tack per subagent for focused execution
- Use subagents liberally for research, exploration, and parallel analysis. One tack per subagent.

### 3. Self-Improvement Loop
### Lessons

- **When to amend** `tasks/lessons.md`: whenever something turns out wrong — user correction, test failure, CI failure, code review feedback, or any other signal that a mistake was made
- **How to amend**: add a bullet with (1) what went wrong, (2) the root cause, (3) a rule that prevents the same mistake
- **Best practice for AI agents**: updating lessons is the primary way to persist learning across sessions; agents lack long-term memory, so `tasks/lessons.md` is the project-specific memory that reduces repeated mistakes
- Write rules for yourself that prevent the same mistake
- Ruthlessly iterate on these lessons until mistake rate drops
- Review lessons at session start for relevant project
- **When**: user correction, test failure, CI failure, code review feedback, or any other mistake signal.
- **How**: add a bullet to `tasks/lessons.md` with (1) what went wrong, (2) root cause, (3) a rule that prevents recurrence.
- This is the primary cross-session memory — ruthlessly iterate until mistake rate drops.

### 4. Verification Before Done
### Verification

- Never mark a task complete without proving it works
- **After every feature/story completion**: Use the `post-feature-qa` skill (`.agentsmesh/skills/post-feature-qa/`) — run the QA checklist, ensure tests cover edge cases and implementation aligns with the story, fix gaps before marking done
- Diff behavior between main and your changes when relevant
- Never mark a task complete without proving it works — run tests, check logs, demonstrate correctness.
- After every feature/story: use `post-feature-qa` skill (`.agentsmesh/skills/post-feature-qa/`).
- Ask yourself: "Would a staff engineer approve this?"
- Run tests, check logs, demonstrate correctness

### 5. Demand Elegance (Balanced)
### Elegance

- For non-trivial changes: pause and ask "is there a more elegant way?"
- If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
- Skip this for simple, obvious fixes - don't over-engineer
- Challenge your own work before presenting it
- Skip this for simple, obvious fixes — don't over-engineer.

### 6. Autonomous Bug Fixing
### Bug Fixing

- When given a bug report: just fix it. Don't ask for hand-holding
- Point at logs, errors, failing tests - then resolve them
- Zero context switching required from the user
- Go fix failing CI tests without being told how

## Task Management

1. **Plan First**: Write plan to `tasks/todo.md` with checkable items
2. **Verify Plan**: Check in before starting implementation
3. **Track Progress**: Mark items complete as you go
4. **Explain Changes**: High-level summary at each step
5. **Document Results**: Add review section to `tasks/todo.md`
6. **Capture Lessons**: Update `tasks/lessons.md` after corrections — see "When to amend" and "How to amend" in Self-Improvement Loop above
- When given a bug report: just fix it. Find root cause, point at logs/errors, resolve. Zero hand-holding.

## Skills

- **post-feature-qa** (`.agentsmesh/skills/post-feature-qa/`) — Apply after every feature or story implementation. Act as senior QA: verify test coverage for all edge cases and story alignment; produce QA report; fix gaps before claiming complete.
- **add-agent-target** (`.agentsmesh/skills/add-agent-target/`) — Use when adding support for a new AI agent target. Requires current official-doc research, full import/generate implementation, rich realistic fixtures, complete unit/integration/e2e coverage, docs updates, and final QA.
- **post-feature-qa** — Apply after every feature/story. Senior QA: verify edge-case coverage and story alignment.
- **add-agent-target** — Use when adding a new AI agent target. Covers research, implementation, fixtures, full test coverage, docs.

## Core Principles

- **Simplicity First**: Make every change as simple as possible. Impact minimal code.
- **Simplicity**: Make every change as simple as possible. Only touch what's necessary.
- **No Laziness**: Find root causes. No temporary fixes. Senior developer standards.
- **Minimal Impact**: Changes should only touch what's necessary. Avoid introducing bugs.

## Project-Specific Rules
## Project Rules

- **TDD mandatory**: Write failing tests FIRST, then implement. No exceptions.
- **TDD mandatory**: Write failing tests FIRST, then implement.
- **Max file size**: 200 lines. Split by responsibility if larger.
- **No classes unless stateful**: Prefer pure functions + types.
- **No `any`**: Use `unknown` + narrowing.
- **Config source of truth**: `.agentsmesh/` directory. Generated files are artifacts.
- **Test naming**: `{module}.test.ts` colocated with source. Integration tests in `tests/integration/`.
- **Generated artifact tests must be strict**: For generated file structures, assert exact file paths, exact file counts, and exact referenced wrapper/script sets. Do not use loose checks like "at least one file", broad `some(...)`, or prefix-only path assertions when the full output set is known.
- **Generated artifact tests must be strict**: Assert exact file paths, exact file counts, and exact referenced wrapper/script sets. No loose checks (`some(...)`, prefix-only, "at least one").
- **Commit format**: conventional commits — `feat|fix|test|refactor(scope): message`
- **README must stay current**: Any change to CLI commands, flags, config schema, supported targets, or canonical file formats **must** be reflected in `README.md` before the task is marked complete. Treat the README as part of the API surface.
- **Website docs must stay current**: Any change to CLI commands, flags, config schema, supported targets, canonical file formats, or other user-facing behavior **must** also be reflected in the documentation website (`website/src/content/docs/`). The website is the primary public documentation — treat it with the same rigor as `README.md`.
- **Docs must stay current**: Any change to CLI commands, flags, config schema, supported targets, or canonical file formats **must** be reflected in both `README.md` and the website (`website/src/content/docs/`) before the task is marked complete.
- **Target data single source of truth** — do **not** hardcode target lists or support levels outside this chain:
1. `src/targets/catalog/target-ids.ts` (`TARGET_IDS`) = canonical target ID list. Each target's `capabilities` in `src/targets/<name>/index.ts` = feature support levels.
2. `src/core/matrix/data.ts` (`SUPPORT_MATRIX`) = built dynamically from descriptors. Never hardcode.
3. `website/src/content/docs/reference/supported-tools.mdx` = **single docs page** for per-target support. All other pages link here — no duplicate tables.
4. `README.md` matrix must stay in sync with code capabilities.
5. No hardcoded target counts or enumerations on homepage, CLI overview, or other pages. Use generic language and link to the matrix.
6. Adding/changing a target: update `target-ids.ts` + descriptor → `supported-tools.mdx` → `README.md` matrix. No other docs pages should need changes.
- **Refer to PRD**: `docs/prd-v2-complete.md` for architecture decisions
- **Refer to tasks**: `docs/agentsmesh-ai-first-tasks.md` for current task specs
Loading
Loading