- Decouple getHoseProvisionalAuthLink from internal closeapi session cache to prevent silent truncation and cache pollution (#137) - Add --force, --refresh, -f options and positive integer validation to auth hose-link - Clarify distinction between Hose web assistance links and Seal delegation tokens across CLI help, SKILL.md, and docs - Add modular issue resolution and PR workflow rule under .agents/rules/
58 lines
3.3 KiB
Markdown
58 lines
3.3 KiB
Markdown
# Agent Customizations & Modular Rules Policy
|
|
|
|
This directory (`.agents/`) maintains modular configuration, skills, and guidelines for AI coding assistants working in the `seal-use` repository.
|
|
|
|
---
|
|
|
|
## 1. Directory Structure
|
|
|
|
```
|
|
.agents/
|
|
├── README.md # This document: architecture & trigger policy
|
|
├── skills.json # Declarative skill path and exclusion filters
|
|
└── rules/ # Modular, domain-specific rule definitions
|
|
├── cli-protocol.md # CLI stdout/stderr stream contract & exit codes
|
|
├── testing.md # Unit/integration testing conventions (bun:test)
|
|
└── typescript-style.md # ESM, explicit .js imports, and TypeScript styles
|
|
```
|
|
|
|
---
|
|
|
|
## 2. Trigger Strategy & Context Budget Management
|
|
|
|
### Why `trigger: "manual"`?
|
|
|
|
In Antigravity (`agy`), rule files located in `.agents/rules/*.md` support YAML frontmatter:
|
|
|
|
```yaml
|
|
---
|
|
description: "..."
|
|
globs: "src/..."
|
|
trigger: "manual"
|
|
---
|
|
```
|
|
|
|
1. **Token Economy**: If set to `trigger: "always_on"`, every turn of the conversation unconditionally injects all rules into the system prompt (`<user_rules>`), consuming ~800 tokens on every request regardless of task relevance.
|
|
2. **On-Demand Activation**: Setting `trigger: "manual"` prevents automatic background injection into the prompt budget. The rules remain available on-demand when explicitly referenced or requested.
|
|
3. **Cross-Agent Neutrality**: Non-agy agents (e.g. OpenAI Codex, Claude Code, Cursor, generic LLMs) do not recognize `agy`'s private frontmatter triggers. Storing modular guidelines as plain Markdown with a manual trigger ensures they function as clean, standalone reference docs that any agent can read on demand via standard file reading tools without unexpected prompt pollution.
|
|
|
|
---
|
|
|
|
## 3. Modular Rules Inventory
|
|
|
|
| Rule File | Domain / Scope | Key Responsibilities |
|
|
| :--- | :--- | :--- |
|
|
| [`rules/issue-pr-workflow.md`](./rules/issue-pr-workflow.md) | Whole Repo / Workflow | GitHub Issue 调研、方案汇报、PR 提交流程,严格杜绝未授权提前发版。 |
|
|
| [`rules/cli-protocol.md`](./rules/cli-protocol.md) | `src/cli/**/*.ts` | Strict `stdout` JSON vs `stderr` diagnostics contract, exit code conventions (`0` vs `1`). |
|
|
| [`rules/testing.md`](./rules/testing.md) | `src/**/*.test.ts` | Test runner (`bun:test`), colocated `*.test.ts`, environment restoration in `afterEach()`. |
|
|
| [`rules/typescript-style.md`](./rules/typescript-style.md) | `src/**/*.ts` | ES modules, mandatory `.js` local extensions, Zod runtime validation, formatting rules. |
|
|
|
|
---
|
|
|
|
## 4. Usage Instructions for AI Agents
|
|
|
|
- **General Tasks & Issue Resolution**: Follow [`rules/issue-pr-workflow.md`](./rules/issue-pr-workflow.md) and the project root `AGENTS.md`. When solving GitHub issues: analyze -> report -> solve -> PR, never trigger release bump or tags without explicit instructions.
|
|
- **CLI Development**: When adding or refactoring CLI commands under `src/cli/`, read [`rules/cli-protocol.md`](./rules/cli-protocol.md) before writing output streams.
|
|
- **Writing Tests**: When creating or modifying tests, read [`rules/testing.md`](./rules/testing.md).
|
|
- **TypeScript & Modules**: When adding new TypeScript files or resolving local imports, refer to [`rules/typescript-style.md`](./rules/typescript-style.md).
|