Skip to content
Open
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
4 changes: 1 addition & 3 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env sh
set -eu

npm run lint
npm run test
npm run build
npm run verify
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
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
node-version: '20'
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI uses node-version '20', but the updated devDependencies (ESLint v10 and related packages) require newer Node minors according to their engines constraints. This can cause npm ci / npm run lint to fail depending on which 20.x runner version GitHub Actions resolves. Pin CI to a Node version that satisfies the toolchain’s minimum (or adjust dependency versions/engines so Node '20' remains valid).

Suggested change
node-version: '20'
node-version: '20.11.1'

Copilot uses AI. Check for mistakes.
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Check formatting
run: npm run format-check

- name: Typecheck
run: npm run typecheck

- name: Lint
run: npm run lint

- name: Audit dependencies
run: npm audit

- name: Test
run: npm test
run: npm test
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
coverage/
node_modules/
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",
"tabWidth": 2,
"semi": true,
"printWidth": 100
}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,104 @@
All notable changes to this project will be documented in this file.

## 3.3.1 - 2026-02-18

- Updated `ajv` in `package-lock.json` to `8.18.0` via `npm audit fix` to remediate a moderate advisory.

## 3.3.0 - 2026-02-18

- Added ruleset-level `claude` companion settings (`enabled` / `output`) with schema validation.
- Compose now generates a `CLAUDE.md` companion file by default with an `@...` import to the primary output.
- Added opt-out support via `claude.enabled: false` and custom companion path support via `claude.output`.
- Updated tests and README/usage docs for companion output behavior and JSON output lists.

## 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.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ Ruleset files accept JSON with `//` or `/* */` comments.
// Optional Claude Code companion output.
"claude": {
"enabled": true,
"output": "CLAUDE.md"
"output": "CLAUDE.md",
},
// Output file name.
"output": "AGENTS.md"
"output": "AGENTS.md",
}
Comment on lines +93 to 97
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSONC ruleset example now includes trailing commas (e.g., after "output": "CLAUDE.md" and after the final "output" field). The CLI parses rulesets via JSON.parse (after stripping comments), so trailing commas will cause a parse error if users copy/paste this example. Update the snippet to be valid for the current parser (remove trailing commas and/or add a prettier-ignore), or extend the parser to tolerate JSONC trailing commas if that’s the intended format.

Copilot uses AI. Check for mistakes.
```

Expand Down Expand Up @@ -147,11 +147,12 @@ 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.

```

## 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"
}
26 changes: 26 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-config-prettier';
import globals from 'globals';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
languageOptions: {
globals: {
...globals.node,
},
parserOptions: {
projectService: {
allowDefaultProject: ['*.js', '*.mjs', 'test/*.js'],
},
tsconfigRootDir: import.meta.dirname,
},
Comment on lines +16 to +20
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint.config.mjs uses import.meta.dirname for tsconfigRootDir. That property isn’t available in all Node versions covered by the current "engines": {"node": ">=20"} range, which can make npm run lint crash on older Node 20.x minors. Either compute the directory from import.meta.url (portable across supported Node versions) or tighten the repo’s Node engine/CI version to one that guarantees import.meta.dirname support.

Copilot uses AI. Check for mistakes.
},
},
{
ignores: ['dist/', 'coverage/', 'AGENTS.md', 'tools/'],
},
);
Loading