Agent Skillstutti-os/tutti › tutti-architecture-review

tutti-architecture-review

GitHub

用于审查Tutti项目的Git差异,检查项目结构、分层、模块所有权及重复的基础设施。通过规划架构审查任务并协调子代理仅关注变更区域,确保代码符合架构规范,而非通用漏洞扫描。

.codex/skills/tutti-architecture-review/SKILL.md tutti-os/tutti

触发场景

用户请求审查tutti的git diff以检查架构合规性 用户指定特定模块进行结构或分层审查 需要对未在当前diff中的命名模块进行静态架构审查

安装

npx skills add tutti-os/tutti --skill tutti-architecture-review -g -y
更多选项

非标准路径

npx skills add https://github.com/tutti-os/tutti/tree/main/.codex/skills/tutti-architecture-review -g -y

不安装直接使用

npx skills use tutti-os/tutti@tutti-architecture-review

指定 Agent (Claude Code)

npx skills add tutti-os/tutti --skill tutti-architecture-review -a claude-code -g -y

安装 repo 全部 skill

npx skills add tutti-os/tutti --all -g -y

预览 repo 内 skill

npx skills add tutti-os/tutti --list

SKILL.md

Frontmatter
{
    "name": "tutti-architecture-review",
    "description": "Review tutti git diffs for project structure, layering, module ownership, and duplicate event-center infrastructure by planning focused architecture review tasks, then having the main agent orchestrate sub-agents for only the changed areas."
}

Tutti Architecture Review

Use this skill when reviewing a tutti change or a named module for repository structure, module ownership, or layering compliance. This is a focused architecture review, not a general bug hunt.

Vocabulary

Use the architecture vocabulary consistently:

  • Module: anything with an interface and an implementation.
  • Interface: everything a caller must know to use the module correctly.
  • Implementation: the code inside a module.
  • Depth: leverage at the interface; deep modules hide useful behavior behind a small interface.
  • Seam: where an interface lives.
  • Adapter: a concrete thing satisfying an interface at a seam.
  • Leverage: what callers get from depth.
  • Locality: what maintainers get from depth.

Prefer these words in findings. Avoid vague substitutes such as "component", "service", "utility", or "boundary" when a vocabulary term fits.

Workflow

  1. Resolve the user's review intent:

    • plain git diff review for the current change
    • module-focused diff review when the user names a module inside the current change
    • static module review when the user wants a named module inspected even without current diff overlap

    Use light natural-language guidance when the request is ambiguous. Do not force the user through a fixed mode menu.

  2. When the user names a module, let the main agent infer a few candidate path keywords and gather candidate paths. Then normalize those paths into a scope file:

    node ./.codex/skills/tutti-architecture-review/scripts/build-review-scope.mjs \
      --input /tmp/tutti-review-candidates.json \
      --output /tmp/tutti-review-scope.json
    

    Candidate input is agent-produced. The script does not invent module keywords or search the repository itself; it only normalizes candidate paths into a stable scope contract for the planner.

    Read references/scope-contract.md when changing or consuming the candidate input, normalized scope output, or planner scope metadata.

  3. Run the review planner from the repository root:

    pnpm review:architecture:package
    

    For module-focused review, pass the generated scope file:

    node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs \
      --scope-file /tmp/tutti-review-scope.json \
      --format json \
      --output-temp
    

    The planner remains git diff first. With --scope-file, it reviews scope ∩ diff when there is overlap, and falls back to scoped-file review only when there is no diff overlap.

    For explicit static module review, force scope-only planning:

    node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs \
      --scope-file /tmp/tutti-review-scope.json \
      --scope-mode static-only \
      --format json \
      --output-temp
    
  4. Read the generated JSON task package from workflowEntry.packagePath. Each task includes riskLevel, spawnRecommendation, summaryForMainAgent, matchedFiles, preflightSignals, and a ready-to-use prompt.

  5. Spawn explorer sub-agents according to spawnRecommendation:

    • required: spawn unless the user explicitly asked for a narrower review
    • recommended: spawn when the review is not trivially small
    • optional: the main agent may review locally

    Do not ask sub-agents to edit files. Their job is to inspect the relevant diff and report architecture findings.

  6. Continue local work while sub-agents run only if there is non-overlapping review or summarization work. Do not duplicate a sub-agent's assigned scope.

  7. Merge sub-agent reports into a code-review style answer:

    • findings first, ordered by severity
    • cite file paths and line numbers when possible
    • explain the violated rule and why it matters for locality, leverage, or dependency direction
    • include "No architecture findings" when a reviewer found no issues

Reviewer Expectations

Every sub-agent should:

  • read AGENTS.md and the closest area AGENTS.md for its changed files
  • read only the reference files listed in the task package, plus files needed to understand the diff
  • inspect the relevant git diff directly instead of relying only on file names
  • report only actionable architecture issues, not taste preferences
  • distinguish hard rule violations from speculative deepening opportunities
  • avoid proposing new interfaces unless the changed code already creates pressure for a real seam
  • when eventing, pub-sub, or bidirectional coordination appears, check whether the shared business event stream's global, desktop, or workspace scope modules already own the seam before accepting new event-center infrastructure

Task Planner

The planner is deterministic and repository-local:

  • scripts/plan-review.mjs reads git diff, optional untracked files, and an optional normalized scope file
  • scripts/build-review-scope.mjs normalizes agent-produced candidate paths into a stable scope contract
  • references/review-rules.json declares reviewer tasks, path rules, and regex-style preflight signals
  • the script maps changed paths to architecture reviewer tasks
  • it adds lightweight preflight signals for suspicious imports, generated-contract drift, possible hardcoded copy, and cross-area seams
  • it assigns task risk and spawn recommendations for the main agent
  • it emits JSON or Markdown for the main agent to orchestrate
  • it never starts sub-agents itself

Useful options:

pnpm review:architecture
pnpm review:architecture:package
pnpm review:architecture:test
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --format markdown
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --format summary
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --base origin/main
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --staged
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --no-untracked
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --scope-file /tmp/tutti-review-scope.json --format summary
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --scope-file /tmp/tutti-review-scope.json --scope-mode static-only --format summary
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --task desktop-layering --format markdown
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --output /tmp/tutti-review-tasks.json
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --output-temp
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --from-package /tmp/tutti-review-tasks.json --format markdown
node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --from-package /tmp/tutti-review-tasks.json --task desktop-layering --format summary

Task Package Entry

A task package file is a stable workflow entrypoint. Prefer creating one before spawning sub-agents, especially for large reviews:

node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --format json --output-temp

Then use workflowEntry.packagePath as the source of truth for the review. If the conversation resumes later, reload the same package instead of recomputing the plan:

node ./.codex/skills/tutti-architecture-review/scripts/plan-review.mjs --from-package /tmp/tutti-architecture-review-YYYYMMDDTHHMMSSZ.json --format markdown

Use --format summary before spawning agents when you need a compact orchestration view. Use --task <id> to inspect or rerender one reviewer from either the current diff or an existing task package.

Run the planner self-test after changing task matching, risk rules, output formats, or task-package behavior:

node --test ./.codex/skills/tutti-architecture-review/scripts/plan-review.test.mjs ./.codex/skills/tutti-architecture-review/scripts/build-review-scope.test.mjs

Read references/tutti-layering.md when a task needs the compact project rules. Read references/scope-contract.md when changing the scope-file contract or the main-agent handoff around module review. Read docs/architecture/business-event-stream.md when reviewing event-center modules, typed pub-sub, or WebSocket-based product coordination. Do not use the architecture review to enforce generated event-protocol drift; that belongs to pnpm check:event-protocol-generated.

Read or edit references/review-rules.json when changing:

  • reviewer task titles, focus, references, or path matching
  • simple preflight regex rules
  • task assignment for preflight signals

Keep combination logic in scripts/plan-review.mjs, such as cross-cutting trigger reasons, generated-source pairing, risk calculation, spawn recommendations, and output rendering.

Keep module-phrase interpretation in the main agent, not in build-review-scope.mjs or plan-review.mjs. Those scripts should stay deterministic and repository-local.

版本历史

  • 5e430ef 当前 2026-07-11 17:00

同 Skill 集合

.codex/skills/tutti-app-release/SKILL.md
packages/ui/system/agent/tutti-ui-system/SKILL.md
services/tuttid/service/workspace/agent_workspace_app_reference/SKILL.md
services/tuttid/service/workspace/app_factory_reference/SKILL.md

元信息

文件数
0
版本
5e430ef
Hash
4fe3884d
收录时间
2026-07-11 17:00

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-14 03:44
浙ICP备14020137号-1 $访客地图$