repo-hc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/README.md +68 -0
- package/.agents/learnings/03_repo-hc-install-bootstrap.md +41 -0
- package/.agents/learnings/examples/01_workspace-peer-dependency-resolution.md +20 -0
- package/.agents/learnings/examples/02_shared-drizzle-workspace-package.md +33 -0
- package/.agents/plans/2026-03-11-github-housekeeping-doc-refresh.md +26 -0
- package/.agents/plans/2026-03-11-publishable-repo-hc-package-bootstrap.md +28 -0
- package/.agents/plans/examples/2026-03-11-add-docs-workflow-guides.md +31 -0
- package/.agents/plans/examples/2026-03-11-central-api-docs-mermaid.md +23 -0
- package/.agents/prompts/03_repo-hc-install-bootstrap.md +17 -0
- package/.agents/prompts/examples/01_workspace-peer-dependency-resolution.md +10 -0
- package/.agents/prompts/examples/02_shared-drizzle-workspace-package.md +10 -0
- package/.agents/rules/01_mask_sensitive-data.md +39 -0
- package/.agents/rules/02_write-in-english.md +23 -0
- package/.agents/rules/03_keep-readme-updated.md +20 -0
- package/.agents/rules/04_use-dedicated-branch-for-large-features.md +25 -0
- package/.agents/rules/05_update-mermaid-on-architecture-changes.md +26 -0
- package/.agents/rules/06_require-comprehensive-feature-docs.md +73 -0
- package/.agents/rules/07_require-feature-plan-and-env-docs.md +39 -0
- package/.agents/rules/08_agents-override-prefer-reusable-modules.md +26 -0
- package/AGENTS.md +299 -0
- package/CONTRIBUTING.md +58 -0
- package/LICENSE.txt +661 -0
- package/README.md +128 -0
- package/SECURITY.md +53 -0
- package/bin/repo-hc.cjs +108 -0
- package/docs/README.md +47 -0
- package/docs/assets/codex-workflow.svg +75 -0
- package/docs/housekeeping/README.md +28 -0
- package/docs/housekeeping/developers.md +86 -0
- package/docs/housekeeping/users.md +59 -0
- package/docs/mermaid/README.md +19 -0
- package/docs/mermaid/housekeeping-architecture.md +48 -0
- package/docs/mermaid/workflow-community-pr-lifecycle.md +33 -0
- package/docs/mermaid/workflow-docs-system.md +29 -0
- package/docs/project/README.md +16 -0
- package/docs/project/rules.md +53 -0
- package/docs/workflow/README.md +20 -0
- package/docs/workflow/developers.md +56 -0
- package/docs/workflow/users.md +42 -0
- package/lib/bootstrap.cjs +103 -0
- package/package.json +40 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Agents Docs Guide
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This folder stores reusable agent knowledge for consistent, safe, and fast collaboration.
|
|
6
|
+
|
|
7
|
+
- `rules/`: mandatory policies for documentation and workflow
|
|
8
|
+
- `plans/`: scoped implementation plans used before coding
|
|
9
|
+
- `learnings/`: reusable implementation learnings and outcomes
|
|
10
|
+
- `prompts/`: sanitized source prompt context
|
|
11
|
+
- `skills/`: task-specific playbooks (`SKILL.md`)
|
|
12
|
+
|
|
13
|
+
## How To Use
|
|
14
|
+
|
|
15
|
+
1. Read relevant files under `rules/` first.
|
|
16
|
+
2. Check `skills/` and apply matching skills before implementation.
|
|
17
|
+
3. Create or update a plan in `plans/` before coding feature work.
|
|
18
|
+
4. When adding a learning, add the matching sanitized prompt where useful.
|
|
19
|
+
5. Mask sensitive data in all stored content.
|
|
20
|
+
6. Keep all text in English unless explicitly requested otherwise.
|
|
21
|
+
7. Update this README whenever `.agents` files are added, removed, or renamed.
|
|
22
|
+
|
|
23
|
+
## Naming Convention
|
|
24
|
+
|
|
25
|
+
- Prefer date-prefixed plan files: `YYYY-MM-DD-<topic>.md`.
|
|
26
|
+
- Keep filenames concise and topic-specific.
|
|
27
|
+
- Keep one clear topic per file.
|
|
28
|
+
|
|
29
|
+
## Current Index
|
|
30
|
+
|
|
31
|
+
### Plans
|
|
32
|
+
|
|
33
|
+
- [2026-03-11-github-housekeeping-doc-refresh.md](./plans/2026-03-11-github-housekeeping-doc-refresh.md)
|
|
34
|
+
- [2026-03-11-publishable-repo-hc-package-bootstrap.md](./plans/2026-03-11-publishable-repo-hc-package-bootstrap.md)
|
|
35
|
+
- [examples/2026-03-11-add-docs-workflow-guides.md](./plans/examples/2026-03-11-add-docs-workflow-guides.md)
|
|
36
|
+
- [examples/2026-03-11-central-api-docs-mermaid.md](./plans/examples/2026-03-11-central-api-docs-mermaid.md)
|
|
37
|
+
|
|
38
|
+
### Learnings
|
|
39
|
+
|
|
40
|
+
- [03_repo-hc-install-bootstrap.md](./learnings/03_repo-hc-install-bootstrap.md)
|
|
41
|
+
- [examples/01_workspace-peer-dependency-resolution.md](./learnings/examples/01_workspace-peer-dependency-resolution.md)
|
|
42
|
+
- [examples/02_shared-drizzle-workspace-package.md](./learnings/examples/02_shared-drizzle-workspace-package.md)
|
|
43
|
+
|
|
44
|
+
### Prompts
|
|
45
|
+
|
|
46
|
+
- [03_repo-hc-install-bootstrap.md](./prompts/03_repo-hc-install-bootstrap.md)
|
|
47
|
+
- [examples/01_workspace-peer-dependency-resolution.md](./prompts/examples/01_workspace-peer-dependency-resolution.md)
|
|
48
|
+
- [examples/02_shared-drizzle-workspace-package.md](./prompts/examples/02_shared-drizzle-workspace-package.md)
|
|
49
|
+
|
|
50
|
+
### Rules
|
|
51
|
+
|
|
52
|
+
- [01_mask_sensitive-data.md](./rules/01_mask_sensitive-data.md)
|
|
53
|
+
- [02_write-in-english.md](./rules/02_write-in-english.md)
|
|
54
|
+
- [03_keep-readme-updated.md](./rules/03_keep-readme-updated.md)
|
|
55
|
+
- [04_use-dedicated-branch-for-large-features.md](./rules/04_use-dedicated-branch-for-large-features.md)
|
|
56
|
+
- [05_update-mermaid-on-architecture-changes.md](./rules/05_update-mermaid-on-architecture-changes.md)
|
|
57
|
+
- [06_require-comprehensive-feature-docs.md](./rules/06_require-comprehensive-feature-docs.md)
|
|
58
|
+
- [07_require-feature-plan-and-env-docs.md](./rules/07_require-feature-plan-and-env-docs.md)
|
|
59
|
+
- [08_agents-override-prefer-reusable-modules.md](./rules/08_agents-override-prefer-reusable-modules.md)
|
|
60
|
+
|
|
61
|
+
### Skills
|
|
62
|
+
|
|
63
|
+
- No repository-local skills currently.
|
|
64
|
+
|
|
65
|
+
## Notes
|
|
66
|
+
|
|
67
|
+
- `examples/` files are historical references and may describe earlier repository phases.
|
|
68
|
+
- New project-direction learnings should be added outside `examples/`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Learning: repo-hc Install Bootstrap to Project Root
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Prompt: `../prompts/03_repo-hc-install-bootstrap.md`
|
|
6
|
+
- Plan: `../plans/2026-03-11-publishable-repo-hc-package-bootstrap.md`
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
The package needed to support one-step installation with:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add repo-hc
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
while ensuring these assets appear in consumer project roots:
|
|
16
|
+
|
|
17
|
+
- `.agents/`
|
|
18
|
+
- `docs/`
|
|
19
|
+
- `AGENTS.md` (canonical)
|
|
20
|
+
- `AGENT.md` (compatibility alias)
|
|
21
|
+
|
|
22
|
+
## Decision
|
|
23
|
+
- Use `postinstall` to run an internal bootstrap command (`repo-hc install`).
|
|
24
|
+
- Implement a non-destructive copy strategy:
|
|
25
|
+
- copy missing files/directories
|
|
26
|
+
- preserve existing files by default
|
|
27
|
+
- allow explicit overwrite via `repo-hc init --force`
|
|
28
|
+
|
|
29
|
+
## Implementation Structure
|
|
30
|
+
- `bin/repo-hc.cjs`: CLI command dispatch (`init`, `install`)
|
|
31
|
+
- `lib/bootstrap.cjs`: reusable recursive copy logic
|
|
32
|
+
- `package.json`: `bin`, `files`, `postinstall`, and test script
|
|
33
|
+
|
|
34
|
+
## Guardrails
|
|
35
|
+
- `install` never breaks package installation if bootstrap fails.
|
|
36
|
+
- `REPO_HC_SKIP_POSTINSTALL=1` allows skipping bootstrap in CI or controlled setups.
|
|
37
|
+
- Global installs are ignored by bootstrap to avoid writing outside intended project roots.
|
|
38
|
+
|
|
39
|
+
## Validation
|
|
40
|
+
- Added `node:test` coverage for copy and force-overwrite behavior.
|
|
41
|
+
- Updated docs to describe install behavior and manual re-run commands.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Workspace Peer-Dependency Resolution: Example Learning
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../../README.md`
|
|
5
|
+
- Prompt: `../../prompts/examples/01_workspace-peer-dependency-resolution.md`
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
During dependency installation in a multi-module workspace, peer dependency warnings appeared for transitive packages.
|
|
9
|
+
|
|
10
|
+
## Root Cause
|
|
11
|
+
An indirect dependency introduced stricter peer requirements that were not satisfied by the currently resolved versions.
|
|
12
|
+
|
|
13
|
+
## Proven Fix
|
|
14
|
+
Add explicitly compatible versions in affected modules and run dependency installation again so the lockfile is updated.
|
|
15
|
+
|
|
16
|
+
## Result
|
|
17
|
+
Peer dependency warnings disappear after installation.
|
|
18
|
+
|
|
19
|
+
## Setup Note For Later
|
|
20
|
+
When dependencies move between beta/alpha channels, verify peer requirements first and pin compatible versions where needed.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Shared Drizzle Workspace Package: Implementation Learnings
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../../README.md`
|
|
5
|
+
- Prompt: `../../prompts/examples/02_shared-drizzle-workspace-package.md`
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
A new large feature introduced a shared Drizzle package under `packages/db` for reuse across apps.
|
|
9
|
+
|
|
10
|
+
## Decisions
|
|
11
|
+
- Created `@workspace/db` as the canonical package for shared DB concerns.
|
|
12
|
+
- Kept responsibilities modular (`schema`, `types`, `config`, `adapters`, `migrations`, `seeds`).
|
|
13
|
+
- Exposed stable subpath exports instead of a single barrel.
|
|
14
|
+
- Implemented runtime-specific adapter factories:
|
|
15
|
+
- `@workspace/db/adapters/node-postgres`
|
|
16
|
+
- `@workspace/db/adapters/libsql`
|
|
17
|
+
- Added explicit connection validation helpers with sanitized error messages.
|
|
18
|
+
- Kept env reads out of schema and adapter modules.
|
|
19
|
+
|
|
20
|
+
## Test And Validation Pattern
|
|
21
|
+
- Add unit tests for adapter config validation, especially invalid input paths.
|
|
22
|
+
- Run package-local checks first:
|
|
23
|
+
- run package-local `typecheck`
|
|
24
|
+
- run package-local `test`
|
|
25
|
+
- Then run workspace-wide checks.
|
|
26
|
+
|
|
27
|
+
## Documentation Pattern
|
|
28
|
+
When a cross-cutting package is added, update both:
|
|
29
|
+
- root docs (`README.md`, `CONTRIBUTING.md`)
|
|
30
|
+
- `.agents/README.md` index (if `.agents` files changed)
|
|
31
|
+
|
|
32
|
+
## Branching Rule Reminder
|
|
33
|
+
This scope is a large feature and must be implemented on a dedicated feature branch, not `main`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Plan: GitHub Housekeeping Package Documentation Refresh
|
|
2
|
+
|
|
3
|
+
## Date
|
|
4
|
+
- 2026-03-11
|
|
5
|
+
|
|
6
|
+
## Goal
|
|
7
|
+
Align repository documentation with the current project direction: a future npm package for automated GitHub housekeeping guided by an AI agent (initially optimized for OpenAI Codex).
|
|
8
|
+
|
|
9
|
+
## Scope
|
|
10
|
+
1. Update `AGENTS.md` to remove stack-specific assumptions that are unrelated to agent behavior rules.
|
|
11
|
+
2. Replace root `README.md` with a package-focused project overview.
|
|
12
|
+
3. Refresh docs under `docs/` so links and narrative match the current repository.
|
|
13
|
+
4. Sync supporting docs (`CONTRIBUTING.md`, `SECURITY.md`, `.agents/README.md`, and affected `.agents/rules/*`) where stale references exist.
|
|
14
|
+
|
|
15
|
+
## Non-Goals
|
|
16
|
+
- Implementing runtime package code.
|
|
17
|
+
- Publishing to npm in this change.
|
|
18
|
+
|
|
19
|
+
## Deliverables
|
|
20
|
+
- Updated guidance for AI-assisted repository housekeeping workflows.
|
|
21
|
+
- New root README with centered shields and actionable onboarding.
|
|
22
|
+
- Cleaned documentation graph with valid links and consistent terminology.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
- Manual link and terminology consistency pass across edited docs.
|
|
26
|
+
- `git diff --name-only` review to ensure changes stay documentation-focused.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Plan: Publishable repo-hc Package Bootstrap
|
|
2
|
+
|
|
3
|
+
## Date
|
|
4
|
+
- 2026-03-11
|
|
5
|
+
|
|
6
|
+
## Goal
|
|
7
|
+
Enable consumers to run `pnpm add repo-hc` (without `-D`) and receive the following assets in their project root:
|
|
8
|
+
- `.agents/`
|
|
9
|
+
- `docs/`
|
|
10
|
+
- `AGENTS.md` (canonical)
|
|
11
|
+
- `AGENT.md` (compatibility alias)
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
1. Add a publishable npm package scaffold (`package.json`, CLI entrypoint, install hook).
|
|
15
|
+
2. Implement non-destructive root bootstrap logic for copying package assets into `INIT_CWD`.
|
|
16
|
+
3. Provide a manual command (`repo-hc init`) for re-running bootstrap.
|
|
17
|
+
4. Add tests for bootstrap copy behavior.
|
|
18
|
+
5. Update documentation to reflect installation and bootstrap behavior.
|
|
19
|
+
|
|
20
|
+
## Non-Goals
|
|
21
|
+
- Implementing full AI workflow runtime logic.
|
|
22
|
+
- Publishing to npm in this change.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
- Run tests for copy behavior.
|
|
26
|
+
- Dry-run local CLI init into a temporary folder.
|
|
27
|
+
- Verify docs mention `pnpm add repo-hc` and expected copied assets.
|
|
28
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Plan: Add Self-Contained Docs and Feature-Branch Workflow Guides
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
Create comprehensive user and developer documentation under `docs/` that explains:
|
|
5
|
+
|
|
6
|
+
- how the self-contained docs system works
|
|
7
|
+
- how the feature-branch + scoped-plan workflow works
|
|
8
|
+
- how this keeps repo history and PRs clean for community collaboration
|
|
9
|
+
- which concrete benefits users receive from this workflow quality model
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
1. Add a new feature docs area `docs/workflow/` with:
|
|
13
|
+
- `README.md`
|
|
14
|
+
- `developers.md`
|
|
15
|
+
- `users.md`
|
|
16
|
+
2. Add Mermaid docs under `docs/mermaid/` for:
|
|
17
|
+
- docs-system structure and update flow
|
|
18
|
+
- community contribution and PR lifecycle
|
|
19
|
+
3. Cross-link all related docs in both directions:
|
|
20
|
+
- `docs/README.md` -> new workflow docs + Mermaid files
|
|
21
|
+
- `docs/workflow/README.md` -> users/developers + Mermaid files
|
|
22
|
+
- Mermaid docs -> docs home + workflow docs
|
|
23
|
+
4. Update `docs/project/README.md` and root `README.md` so the new workflow docs are discoverable from existing entry points.
|
|
24
|
+
5. Add a concise `.agents` learning + prompt entry if reusable process guidance emerges.
|
|
25
|
+
|
|
26
|
+
## Security Considerations
|
|
27
|
+
- Keep the workflow docs explicit about server-side authz and secret handling responsibilities.
|
|
28
|
+
- Reinforce documentation-as-contract to reduce unsafe or undocumented changes.
|
|
29
|
+
|
|
30
|
+
## Environment Variables
|
|
31
|
+
No new environment variables are introduced by this documentation change.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Plan: Central API Architecture Docs Update
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
Update `/docs` architecture diagrams to show:
|
|
5
|
+
- `apps/api` as the central backend boundary
|
|
6
|
+
- `apps/admc` and `apps/frontend` connect to `apps/api`
|
|
7
|
+
- only `apps/api` connects to the database
|
|
8
|
+
|
|
9
|
+
## Scope
|
|
10
|
+
- `docs/mermaid/admc-architecture.md`
|
|
11
|
+
- `docs/mermaid/api-architecture.md`
|
|
12
|
+
- `docs/mermaid/db-architecture.md`
|
|
13
|
+
- new central architecture Mermaid file under `docs/mermaid/`
|
|
14
|
+
- index/link updates in docs files that list Mermaid diagrams
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
1. Add a new system-level Mermaid diagram showing runtime boundaries and allowed data flow.
|
|
18
|
+
2. Update existing architecture Mermaid docs so they all match the same boundary model.
|
|
19
|
+
3. Update docs indexes (`docs/README.md` and feature README files where relevant) to include the new diagram links.
|
|
20
|
+
4. Verify links and Mermaid syntax consistency.
|
|
21
|
+
|
|
22
|
+
## Security Intent
|
|
23
|
+
Keep architecture docs explicit that DB access is server-side only through `apps/api`, with no direct DB path from clients (`apps/frontend` / `apps/admc`).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Prompt: repo-hc One-Step Install Bootstrap
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Learning: `../learnings/03_repo-hc-install-bootstrap.md`
|
|
6
|
+
- Plan: `../plans/2026-03-11-publishable-repo-hc-package-bootstrap.md`
|
|
7
|
+
|
|
8
|
+
## Original Prompt (Sanitized)
|
|
9
|
+
```text
|
|
10
|
+
What is required so users can run "pnpm add repo-hc" and automatically receive:
|
|
11
|
+
- .agents
|
|
12
|
+
- docs
|
|
13
|
+
- AGENTS.md (canonical)
|
|
14
|
+
- AGENT.md (compatibility alias)
|
|
15
|
+
|
|
16
|
+
Implement it without using -D.
|
|
17
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Prompt: Workspace Peer-Dependency Resolution
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../../README.md`
|
|
5
|
+
- Learning: `../../learnings/examples/01_workspace-peer-dependency-resolution.md`
|
|
6
|
+
|
|
7
|
+
## Original Prompt
|
|
8
|
+
```text
|
|
9
|
+
Fix peer dependency warnings in this workspace install.
|
|
10
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Rule: Always Mask Sensitive Data
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./02_write-in-english.md`
|
|
6
|
+
- Related Rule: `./03_keep-readme-updated.md`
|
|
7
|
+
|
|
8
|
+
## Scope
|
|
9
|
+
This rule applies to the creation and maintenance of:
|
|
10
|
+
|
|
11
|
+
- Learnings
|
|
12
|
+
- Prompts
|
|
13
|
+
- Docs
|
|
14
|
+
- Notes and internal agent files
|
|
15
|
+
|
|
16
|
+
## Requirement
|
|
17
|
+
Sensitive data must always be masked or removed.
|
|
18
|
+
No real secrets may appear in files or examples.
|
|
19
|
+
|
|
20
|
+
## Never Store Unmasked
|
|
21
|
+
- API Keys
|
|
22
|
+
- Access Tokens / Refresh Tokens
|
|
23
|
+
- Passwords
|
|
24
|
+
- Private Keys / Certificate Contents
|
|
25
|
+
- Session-Cookies
|
|
26
|
+
- Webhook Secrets
|
|
27
|
+
- Connection strings with credentials
|
|
28
|
+
- Personal or confidential operational data
|
|
29
|
+
|
|
30
|
+
## Allowed Representation
|
|
31
|
+
Use placeholders only, for example:
|
|
32
|
+
|
|
33
|
+
- `<API_KEY_REDACTED>`
|
|
34
|
+
- `<TOKEN_REDACTED>`
|
|
35
|
+
- `<PASSWORD_REDACTED>`
|
|
36
|
+
- `<SECRET_REDACTED>`
|
|
37
|
+
|
|
38
|
+
## Decision Rule
|
|
39
|
+
If it is unclear whether a value is sensitive, treat it as sensitive and mask it.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Rule: Write All Text in English
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./01_mask_sensitive-data.md`
|
|
6
|
+
- Related Rule: `./03_keep-readme-updated.md`
|
|
7
|
+
|
|
8
|
+
## Scope
|
|
9
|
+
This rule applies to all written project content, including:
|
|
10
|
+
|
|
11
|
+
- Learnings
|
|
12
|
+
- Prompts
|
|
13
|
+
- Documentation
|
|
14
|
+
- Notes and internal agent files
|
|
15
|
+
|
|
16
|
+
## Requirement
|
|
17
|
+
All text must be written in English.
|
|
18
|
+
|
|
19
|
+
## Exceptions
|
|
20
|
+
Use another language only if explicitly requested by the user for that specific content.
|
|
21
|
+
|
|
22
|
+
## Consistency
|
|
23
|
+
Headings, labels, examples, and inline comments in docs must also be in English.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Rule: Keep README Updated
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./01_mask_sensitive-data.md`
|
|
6
|
+
- Related Rule: `./02_write-in-english.md`
|
|
7
|
+
|
|
8
|
+
## Scope
|
|
9
|
+
This rule applies to all changes under `.agents`.
|
|
10
|
+
|
|
11
|
+
## Requirement
|
|
12
|
+
Whenever files are added, removed, renamed, or their purpose changes in `.agents`, update `.agents/README.md` in the same change.
|
|
13
|
+
|
|
14
|
+
## Minimum README Update
|
|
15
|
+
- Keep the index current (learnings, prompts, rules).
|
|
16
|
+
- Keep usage instructions aligned with the current workflow.
|
|
17
|
+
- Keep cross-links valid.
|
|
18
|
+
|
|
19
|
+
## Enforcement
|
|
20
|
+
A docs change is incomplete if `README.md` is outdated.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Rule: Use a Dedicated Git Branch for Large Features
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./03_keep-readme-updated.md`
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
This rule applies to all new large feature work.
|
|
9
|
+
|
|
10
|
+
## Requirement
|
|
11
|
+
For every new large feature, create and use a dedicated git branch.
|
|
12
|
+
Do not implement large features directly on `main`.
|
|
13
|
+
|
|
14
|
+
## What Counts as a Large Feature
|
|
15
|
+
Treat work as a large feature if one or more of the following is true:
|
|
16
|
+
|
|
17
|
+
- It affects multiple modules, docs sections, or workflows.
|
|
18
|
+
- It introduces new architecture, major workflows, or cross-cutting behavior.
|
|
19
|
+
- It requires multiple commits over more than one working session.
|
|
20
|
+
- It has elevated risk, migration impact, or broad testing surface.
|
|
21
|
+
|
|
22
|
+
## Branch Guidance
|
|
23
|
+
- Use clear branch names, for example: `feat/<topic>` or `feature/<topic>`.
|
|
24
|
+
- Keep branch scope focused to one feature.
|
|
25
|
+
- Open a PR for review before merge.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Rule: Update Mermaid Diagrams on Architecture Changes
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./03_keep-readme-updated.md`
|
|
6
|
+
- Related Rule: `./04_use-dedicated-branch-for-large-features.md`
|
|
7
|
+
- Related Rule: `./06_require-comprehensive-feature-docs.md`
|
|
8
|
+
|
|
9
|
+
## Scope
|
|
10
|
+
This rule applies whenever architecture is added, changed, or removed.
|
|
11
|
+
|
|
12
|
+
## Requirement
|
|
13
|
+
When architecture changes, update documentation in the same change and include updated Mermaid diagrams that reflect the new architecture.
|
|
14
|
+
|
|
15
|
+
## Documentation Targets
|
|
16
|
+
- Prefer files under `docs/mermaid/` for architecture and workflow diagrams.
|
|
17
|
+
- Keep related references in `AGENTS.md` and `.agents` aligned when architecture guidance changes.
|
|
18
|
+
|
|
19
|
+
## Minimum Update
|
|
20
|
+
- Add or update at least one Mermaid diagram for the changed architecture.
|
|
21
|
+
- Ensure diagram nodes, boundaries, and data flow match the implementation.
|
|
22
|
+
- Ensure Mermaid syntax renders on GitHub (quote labels with special characters where needed).
|
|
23
|
+
- Remove or replace stale Mermaid diagrams that no longer reflect reality.
|
|
24
|
+
|
|
25
|
+
## Enforcement
|
|
26
|
+
Architecture changes are incomplete if Mermaid architecture docs are missing or outdated.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Rule: Require Comprehensive Feature Documentation
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./03_keep-readme-updated.md`
|
|
6
|
+
- Related Rule: `./05_update-mermaid-on-architecture-changes.md`
|
|
7
|
+
|
|
8
|
+
## Scope
|
|
9
|
+
This rule applies to every feature that changes one or more of the following:
|
|
10
|
+
|
|
11
|
+
- architecture
|
|
12
|
+
- setup or runtime configuration
|
|
13
|
+
- developer workflow
|
|
14
|
+
- user-facing behavior
|
|
15
|
+
- shared contracts or interfaces
|
|
16
|
+
|
|
17
|
+
## Requirement
|
|
18
|
+
For in-scope feature work, documentation is part of the implementation and must be added or updated in the same change.
|
|
19
|
+
|
|
20
|
+
## Mandatory Documentation Structure
|
|
21
|
+
For each affected feature area `<feature>`:
|
|
22
|
+
|
|
23
|
+
1. Add or update `docs/<feature>/developers.md`.
|
|
24
|
+
2. Add or update `docs/<feature>/users.md`.
|
|
25
|
+
3. Add or update `docs/<feature>/README.md` as a local index.
|
|
26
|
+
4. Add or update Mermaid diagrams in `docs/mermaid/` (at minimum architecture or workflow).
|
|
27
|
+
5. Add or update global index links in `docs/README.md`.
|
|
28
|
+
|
|
29
|
+
## Content Expectations
|
|
30
|
+
|
|
31
|
+
### Developer Documentation (`developers.md`)
|
|
32
|
+
Must cover:
|
|
33
|
+
|
|
34
|
+
- architecture intent and boundaries
|
|
35
|
+
- setup and environment requirements
|
|
36
|
+
- validation and test workflow
|
|
37
|
+
- extension/change workflow
|
|
38
|
+
- security notes
|
|
39
|
+
- troubleshooting for common failures
|
|
40
|
+
|
|
41
|
+
### User Documentation (`users.md`)
|
|
42
|
+
Must cover:
|
|
43
|
+
|
|
44
|
+
- quick start and primary usage flows
|
|
45
|
+
- stable API/usage surface
|
|
46
|
+
- safe integration examples
|
|
47
|
+
- limitations and constraints
|
|
48
|
+
- FAQ or operational notes where relevant
|
|
49
|
+
|
|
50
|
+
### Mermaid Documentation
|
|
51
|
+
Must cover:
|
|
52
|
+
|
|
53
|
+
- system architecture or data flow
|
|
54
|
+
- at least one runtime or change workflow
|
|
55
|
+
- GitHub-compatible Mermaid syntax (quote labels when using special characters)
|
|
56
|
+
|
|
57
|
+
## Linking Requirements
|
|
58
|
+
Cross-link all relevant docs in both directions:
|
|
59
|
+
|
|
60
|
+
- `docs/README.md` -> feature docs + Mermaid docs
|
|
61
|
+
- `docs/<feature>/README.md` -> developers/users + Mermaid docs
|
|
62
|
+
- each Mermaid file -> docs home + related feature docs
|
|
63
|
+
|
|
64
|
+
## Definition of Done
|
|
65
|
+
A feature is not done until:
|
|
66
|
+
|
|
67
|
+
- implementation and docs are merged together
|
|
68
|
+
- docs link graph is complete and non-stale
|
|
69
|
+
- Mermaid diagrams match the current implementation
|
|
70
|
+
- no duplicated or contradictory setup/usage instructions remain
|
|
71
|
+
|
|
72
|
+
## Enforcement
|
|
73
|
+
PRs that change in-scope behavior without the required docs updates should be treated as incomplete.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Rule: Require Feature Plans and Environment Variable Documentation
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./04_use-dedicated-branch-for-large-features.md`
|
|
6
|
+
- Related Rule: `./06_require-comprehensive-feature-docs.md`
|
|
7
|
+
|
|
8
|
+
## Scope
|
|
9
|
+
This rule applies to all feature work, regardless of feature size.
|
|
10
|
+
|
|
11
|
+
## Requirement
|
|
12
|
+
Every feature must include:
|
|
13
|
+
|
|
14
|
+
1. A dedicated feature branch.
|
|
15
|
+
2. A scoped implementation plan before coding.
|
|
16
|
+
3. Documentation updates for any new environment variables.
|
|
17
|
+
|
|
18
|
+
## Branch Requirement
|
|
19
|
+
- Do not implement feature work directly on `main`.
|
|
20
|
+
- Use clear branch naming such as `feat/<topic>` or `feature/<topic>`.
|
|
21
|
+
|
|
22
|
+
## Plan Requirement
|
|
23
|
+
- Create or update a plan before implementation starts.
|
|
24
|
+
- Prefer storing plans under `.agents/plans/`.
|
|
25
|
+
- Keep the plan focused, actionable, and aligned with final implementation.
|
|
26
|
+
|
|
27
|
+
## Environment Variable Documentation Requirement
|
|
28
|
+
When introducing or changing environment variables:
|
|
29
|
+
|
|
30
|
+
- Add the variable to `.env.example` in the same change.
|
|
31
|
+
- Document it in relevant developer docs (at minimum in `docs/<feature>/developers.md` or equivalent).
|
|
32
|
+
- Include:
|
|
33
|
+
- purpose
|
|
34
|
+
- server-only vs public exposure scope
|
|
35
|
+
- expected format/example placeholder
|
|
36
|
+
- default/fallback behavior (if any)
|
|
37
|
+
|
|
38
|
+
## Enforcement
|
|
39
|
+
Feature work is incomplete if branch + plan + env-doc requirements are not satisfied.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# AGENTS Override: Prefer Reusable Internal Modules
|
|
2
|
+
|
|
3
|
+
## Links
|
|
4
|
+
- README: `../README.md`
|
|
5
|
+
- Related Rule: `./03_keep-readme-updated.md`
|
|
6
|
+
|
|
7
|
+
## Override Policy
|
|
8
|
+
Whenever useful, prefer reusable internal modules over one-off implementation blocks.
|
|
9
|
+
|
|
10
|
+
## Applies To
|
|
11
|
+
- policy definitions
|
|
12
|
+
- orchestration helpers
|
|
13
|
+
- GitHub adapter logic
|
|
14
|
+
- shared utilities and domain helpers
|
|
15
|
+
- shared type contracts
|
|
16
|
+
|
|
17
|
+
## Decision Heuristic
|
|
18
|
+
Prefer extracting a reusable module when at least one condition is true:
|
|
19
|
+
|
|
20
|
+
- logic is likely to be reused by multiple workflows
|
|
21
|
+
- logic encodes shared domain behavior
|
|
22
|
+
- logic is expected to grow and needs isolated tests
|
|
23
|
+
- keeping it inline would duplicate patterns
|
|
24
|
+
|
|
25
|
+
## Exception
|
|
26
|
+
Keep implementation local when it is clearly one-off and unlikely to be reused.
|