Skip to content

docs: add agent-readable CLAUDE.md and SPEC.md#1206

Closed
howar31 wants to merge 2 commits intomirror-media:mainfrom
howar31:docs/agent-specs
Closed

docs: add agent-readable CLAUDE.md and SPEC.md#1206
howar31 wants to merge 2 commits intomirror-media:mainfrom
howar31:docs/agent-specs

Conversation

@howar31
Copy link
Copy Markdown
Contributor

@howar31 howar31 commented Apr 13, 2026

Summary

  • Add project-level CLAUDE.md for Claude Code guidance (run commands, architecture, conventions)
  • Add root SPEC.md with full monorepo architecture spec and per-package links
  • Add package-level SPEC.md for mirrormedia, mirrortv, mirrordaily, readr, mesh — each documents lists, storage, mini-apps, env vars, and unique features

Test plan

  • Verify CLAUDE.md is accessible at repo root
  • Verify root SPEC.md package links resolve correctly
  • Verify each package SPEC.md is accurate against the actual code

🤖 Generated with Claude Code

Add project-level CLAUDE.md for Claude Code guidance, update root
SPEC.md with per-package links, and add package-level SPEC.md for
mirrormedia, mirrortv, mirrordaily, readr, and mesh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@howar31 howar31 self-assigned this Apr 13, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive documentation for the Lilith CMS monorepo, including a CLAUDE.md guide for AI agents and detailed SPEC.md files for the root and individual CMS packages (mesh, mirrordaily, mirrormedia, mirrortv, and readr). The review feedback identifies a critical security vulnerability where mirrordaily and mirrortv specify an 8GB JSON body parser limit, which poses a significant risk of Denial of Service (DoS) via memory exhaustion. Additionally, the reviewer noted inconsistencies in port mapping between the root and package-level specifications and recommended consistent documentation of the 'restricted' access control strategy across all environment variable tables.

- `PopularTag`:熱門標籤追蹤

### Large Payload Support
JSON body parser 上限設為 **8 GB**,支援大型影音檔案上傳。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Setting the JSON body parser limit to 8 GB is extremely dangerous as it exposes the server to Denial of Service (DoS) attacks via memory exhaustion. Large file uploads (like video) should be handled via streaming (e.g., multipart/form-data) rather than being parsed as a JSON body. Please verify if this is a documentation error or if the underlying code needs to be restricted to a much lower limit (typically < 1MB for JSON).

Comment thread packages/mirrortv/SPEC.md
透過 `YOUTUBE_API_KEY` 整合 YouTube Data API,供影片資料同步使用。

### Large Payload Support
JSON body parser 上限設為 **8 GB**,支援大型影音檔案上傳。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Setting the JSON body parser limit to 8 GB is extremely dangerous as it exposes the server to Denial of Service (DoS) attacks via memory exhaustion. Large file uploads (like video) should be handled via streaming (e.g., multipart/form-data) rather than being parsed as a JSON body. Please verify if this is a documentation error or if the underlying code needs to be restricted to a much lower limit (typically < 1MB for JSON).

Comment thread SPEC.md Outdated
Comment on lines +21 to +22
| `readr` | CMS App | — | Readr CMS | [SPEC](packages/readr/SPEC.md) |
| `mesh` | CMS App | — | Mesh CMS | [SPEC](packages/mesh/SPEC.md) |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The ports for readr and mesh are marked as here, but their respective package-level SPEC.md files define them as 3000. This creates a conflict with mirrormedia which also uses port 3000. Please synchronize the port assignments in this table to reflect the actual configuration and resolve the port collisions to ensure a smooth local development experience.

Comment thread SPEC.md
Comment on lines +127 to +132
| Strategy | Behavior |
| --- | --- |
| `cms` | Standard role-based access. Preview mini-app enabled. |
| `gql` | Public read (for frontend APIs); published items only |
| `preview` | All items readable (for preview servers) |
| `restricted` | Blocks User list queries/updates/deletes by default |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The restricted access control strategy is documented here and in CLAUDE.md, but it is missing from the ACCESS_CONTROL_STRATEGY environment variable tables in all individual package specs (e.g., mirrormedia, mirrordaily, mirrortv, readr, mesh). If this strategy is a core feature available to all packages, it should be consistently documented in the package-level specs as well.

Comment thread packages/mirrordaily/SPEC.md Outdated

| Variable | Default | Purpose |
| --- | --- | --- |
| `ACCESS_CONTROL_STRATEGY` | `cms` | `cms` / `gql` / `preview` |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The restricted strategy is mentioned in the root SPEC.md and CLAUDE.md but is missing from this package's environment variable documentation. Please include it for consistency.

Suggested change
| `ACCESS_CONTROL_STRATEGY` | `cms` | `cms` / `gql` / `preview` |
| ACCESS_CONTROL_STRATEGY | cms | cms / gql / preview / restricted |

…ge SPECs

- Update readr and mesh port from — to 3000 in root SPEC.md
- Add restricted to ACCESS_CONTROL_STRATEGY docs in all 5 package SPECs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@howar31 howar31 closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant