Skip to content
Closed
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
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,29 @@ labels: bug
---

## Summary

A clear and concise description of the problem.

## Steps to reproduce
1.
2.
3.

1.
2.
3.

## Expected behavior

What you expected to happen.

## Actual behavior

What actually happened.

## Environment

- OS:
- Node.js:
- Version:

## Additional context
Add any other context, logs, or screenshots here.

Add any other context, logs, or screenshots here.
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ labels: enhancement
---

## Summary

A clear and concise description of the feature.

## Problem / motivation

What problem does this solve?

## Proposed solution

Describe the solution you'd like.

## Alternatives considered

Describe any alternative solutions or features you've considered.

## Additional context
Add any other context or screenshots about the feature request here.

Add any other context or screenshots about the feature request here.
8 changes: 6 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
## Summary

Describe the change and why it is needed.

## Changes
-

-

## Testing

- [ ] npm run lint
- [ ] npm test
- [ ] npm pack --dry-run (if publishing-related)

## Checklist

- [ ] README.md updated or not needed (explain why)
- [ ] No generated artifacts committed
- [ ] Changes are scoped to the affected repository only
- [ ] Changes are scoped to the affected repository only
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Test
run: npm test
- name: Verify
run: npm run verify
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
node_modules/
coverage/
AGENTS.md
package-lock.json
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"semi": true
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,93 @@
All notable changes to this project will be documented in this file.

## 3.2.7 - 2026-02-07

- Print a unified diff for `AGENTS.md` when it changes during compose/apply-rules (works without git).
- Suppress the diff/recognition hint output when using `--quiet` or `--json`.
- Added regression tests for the diff output behavior.

## 3.2.6 - 2026-02-06

- Enhanced `edit-rules` output to show the rules directory and concrete next steps for editing and applying rule updates.
- Added tests that verify the new `edit-rules` guidance output for local source layouts.
- Documented that `apply-rules` pushes the workspace for GitHub sources (when clean) before regenerating `AGENTS.md`.
- Updated README shared-rules update flow text to match the current CLI behavior.
- Regenerated `AGENTS.md` with updated tool rules and latest upstream shared rule content.

## 3.2.5 - 2026-02-06

- Clarified that `tools/tool-rules.md` is the shared rule source for all repositories using compose-agentsmd.
- Added a rule that planned rule updates must be shown first (preferably as a colorized diff) and require explicit approval before edits are applied.
- Regenerated `AGENTS.md` with the updated tool rules and latest shared upstream rule content.

## 3.2.4 - 2026-02-02

- Refactored CLI argument value parsing to reduce duplication.

## 3.2.3 - 2026-02-01

- Restored shared tool rules to use `compose-agentsmd` and moved the repo-specific compose instruction into a local rule.
- Added a local rules file and wired it into the ruleset, then regenerated `AGENTS.md`.

## 3.2.2 - 2026-02-01

- Normalized AGENTS.md Source paths to GitHub-style refs for remote rules and project-relative paths for local rules, with matching test updates.
- Added a pre-commit hook to run lint/test/build.
- Updated the ruleset to use `github:metyatech/agent-rules` with `cli`/`release` domains, removing the local release extra and regenerating AGENTS.md with the shared rules.
- Clarified tool rules location and rule-update diff requirements, and switched this repo to generate rules via `npm run compose`.
- Bumped @types/node to ^25.1.0.

## 3.2.1 - 2026-01-27

- Regenerated `AGENTS.md` to exclude the `AGENTS.md` file from rule diff output.

## 1.0.1 - 2026-01-25

- Switched the package to ESM (`"type": "module"`, NodeNext compiler options).
- Hardened npm publish settings (`publishConfig.access`, `files`, `prepare`).
- Expanded test coverage for rules root precedence and ruleset validation.
- Added GitHub community health files and CI workflow.
- Regenerated `AGENTS.md` from the updated rule modules.

## 1.1.0 - 2026-01-26

- Added JSON Schema validation for rulesets with an explicit schema file.
- Prepended tool guidance rules to generated `AGENTS.md` files.
- Updated shared rule modules for JSON schema validation and English rule writing guidance.

## 1.1.1 - 2026-01-26

- Clarified that README updates must be edited at the same time as code changes in shared rules.

## 1.1.2 - 2026-01-26

- Clarified that version bumps must include both release creation and package publishing.

## 2.0.0 - 2026-01-26

- Switched ruleset format to `source/global/domains/extra` with remote GitHub sources and cache support in `~/.agentsmd`.
- Added `--refresh` and `--clear-cache` cache management commands.
- Updated ruleset schema, tests, and README to match the new format.

## 2.0.1 - 2026-01-26

- Moved the publish/global-update rule into local rules for this repository.

## 2.0.2 - 2026-01-26

- Externalized tool-inserted rules and usage text into `tools/`.
- Added rule guidance to externalize long embedded strings/templates when possible.

## 3.0.0 - 2026-01-26

- Removed recursive ruleset discovery; only the project root ruleset is composed unless `--ruleset` is provided.

## 3.1.0 - 2026-01-26

- Added `--version`/`-V` and `--verbose`/`-v` flags with verbose diagnostics output.

## 3.2.0 - 2026-01-26

- Added `init` to bootstrap rulesets with dry-run, confirmation, and compose options.
- Allowed ruleset files to include line/block comments (JSON with comments).
- Updated init defaults to use generic GitHub sources and omit global/domains/extra unless specified.
7 changes: 6 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# Code of Conduct

## Our pledge

We are committed to providing a friendly, safe, and welcoming environment for everyone.

## Expected behavior

- Be respectful and considerate.
- Assume good intent and collaborate constructively.
- Provide and accept feedback gracefully.

## Unacceptable behavior

- Harassment, discrimination, or hateful conduct.
- Personal attacks, trolling, or intimidation.
- Publishing private information without permission.

## Enforcement

Maintainers may remove, edit, or reject contributions that violate this Code of Conduct.

## Reporting
Report issues to the maintainers via GitHub Security Advisories or a private channel when possible.

Report issues to the maintainers via GitHub Security Advisories or a private channel when possible.
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Contributing

## Development setup

1. Install dependencies.
2. Run lint and tests before submitting changes.

Expand All @@ -11,6 +12,7 @@ npm test
```

## Rules composition workflow

This repository treats `AGENTS.md` as a generated file.

- Do not edit `AGENTS.md` directly.
Expand All @@ -22,6 +24,7 @@ npm run compose
```

## Pull requests

- Keep changes scoped to the affected repository.
- Include tests for behavioral changes.
- Update `README.md` when usage or behavior changes.
- Update `README.md` when usage or behavior changes.
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Ruleset files accept JSON with `//` or `/* */` comments.
// Additional local rule files to append.
"extra": ["agent-rules-local/custom.md"],
// Output file name.
"output": "AGENTS.md"
"output": "AGENTS.md",
}
```

Expand Down Expand Up @@ -133,14 +133,23 @@ Remote sources are cached under `~/.agentsmd/cache/<owner>/<repo>/<ref>/`. Use `

```sh
npm install
npm run lint
npm run build
npm test
```

## Overview
This repository contains the compose-agentsmd project.

## Requirements and Configuration
- No required environment variables are documented.

npm run verify
```

`npm run verify` runs linting, typechecking, formatting checks, and tests.
You can also run them individually:

```sh
npm run lint # Check for lint issues
npm run typecheck # Check for type errors
npm run format # Fix formatting
npm test # Run tests
```

## Overview

This repository contains the compose-agentsmd project.

## Requirements and Configuration

- No required environment variables are documented.
5 changes: 4 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Security Policy

## Supported versions

The latest published version is supported.

## Reporting a vulnerability

Please report vulnerabilities privately via GitHub Security Advisories or by opening a private report to the maintainers. Do not file public issues for security-sensitive reports.

When reporting, include:

- A clear description of the vulnerability
- Steps to reproduce or a proof of concept
- Impact assessment
- Suggested mitigations (if known)

We will acknowledge receipt and work on a fix as quickly as possible.
We will acknowledge receipt and work on a fix as quickly as possible.
2 changes: 1 addition & 1 deletion agent-rules-local/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Distribution and release

- After publishing this repository, update the globally installed CLI to the latest version.
- After publishing this repository, update the globally installed CLI to the latest version.
12 changes: 3 additions & 9 deletions agent-ruleset.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
{
"source": "github:metyatech/agent-rules",
"domains": [
"cli",
"node",
"release"
],
"extra": [
"agent-rules-local/compose-agentsmd-local.md"
],
"domains": ["cli", "node", "release"],
"extra": ["agent-rules-local/compose-agentsmd-local.md"],
"output": "AGENTS.md"
}
22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-config-prettier';

export default tseslint.config(
{
ignores: ['dist/', 'coverage/', 'AGENTS.md', 'agent-rules-local/'],
},
js.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
},
},
},
);
Loading