miloya-codebase
miloya-codebase
Project context engine for fast repo orientation, cached handoff, and task-focused code retrieval.
Artifacts:
- Snapshot:
{project}/repo/progress/miloya-codebase.json - Index state:
{project}/repo/progress/miloya-codebase.index.json
When To Use
Use this skill when you need to:
- understand a codebase quickly
- refresh a reusable project snapshot
- retrieve focused files and snippets for a concrete question
- prepare a deep technical walkthrough from a cached project context
Modes
/miloya-codebase
Default entry.
Behavior:
- Generate a new snapshot when none exists
- Reuse the cached snapshot when the source fingerprint is unchanged
- Return a project overview optimized for fast model understanding
Use it when:
- entering a project for the first time
- switching to a new model or IDE
- you want a general repo overview
/miloya-codebase refresh
Force regenerate the snapshot.
Behavior:
- Ignore cache reuse
- Re-scan the project and overwrite the existing snapshot
Use it when:
- the codebase changed significantly
- you suspect the snapshot is stale
- you explicitly do not want cache reuse
/miloya-codebase read
Focused retrieval mode.
Behavior:
- Consume the existing snapshot and index
- Skip forced regeneration logic
- Return a retrieval-oriented payload with:
filessnippetsflowAnchorsnextHopssearchScopehotspotsexternalContext
Use it when:
- the snapshot already exists
- you want fast file and snippet retrieval for a specific question
- you want to preserve tokens and avoid rescanning
Host requirements:
- Explicitly say read mode is consuming the existing snapshot and index
- Do not imply the repo is being rescanned
- Start from
files,snippets,nextHops, andsearchScope - Do not jump to repo-wide search first
Preferred opening:
我将直接读取已有快照和索引,不重新扫描仓库。我会先用 read payload 里的 files、snippets 和 nextHops 做定点读取,不先做全仓搜索。
Avoid:
我先重新加载项目上下文。我先重新扫描仓库。
Read answer contract:
- Treat
readas a quick implementation summary, not a deep technical report - Use this order when the payload has enough evidence:
- one-sentence conclusion
- call entry
- core implementation files
- key anchors
- one-sentence implementation summary
- Prefer 3-4 core files and 3-5 anchors
- Prioritize entry points and execution flow before type definitions or tables
- Stop once the next model can continue reading code efficiently
- Leave exhaustive tracing, edge cases, and broader architecture to
report
/miloya-codebase report
Deep-analysis mode.
Behavior:
- Consume the existing snapshot and index when present
- Generate a snapshot first only when missing
- Return a
deep-packfor host-side deep report generation - Treat
deep-packgeneration as the default stopping point for the parent thread
Use it when:
- you want a full technical report
- you want a complete call chain or architecture trace
- you want to preserve the parent thread token budget
Host requirements:
- Explicitly say report mode is consuming the existing snapshot and index
- Mention snapshot generation only if the snapshot is actually missing
- Prefer delegating
deep-packto a subagent or delegated worker - Do not continue parent-thread
Read/Searchexpansion after the pack is generated unless delegation is unavailable
Preferred opening:
我将基于已有快照和索引生成 deep-pack,不重新扫描仓库。如果宿主支持 subagent,我会优先把 deep-pack 交给子任务处理。在可委派的情况下,我会停在 deep-pack 边界,不在主线程继续展开长报告。
Avoid:
我先重新分析整个仓库再写报告。deep-pack 已生成,现在我继续在主线程读取关键文件并输出完整长报告。
Execution Semantics
The entrypoint is always scripts/generate.py, but the mode determines whether
source code is scanned or cached artifacts are consumed:
- default mode: may generate a snapshot or reuse a cached one
refresh: always rescans and overwrites the cached snapshotread: consumes the existing snapshot and index to build a retrieval payloadreport: consumes the existing snapshot and index to build adeep-pack
Important clarifications:
- Seeing
python ... generate.py ... --reador--reportdoes not mean the repo is being rescanned freshness.reasoninside areadorreportpayload describes how the current snapshot was produced previously; it does not mean the current invocation regenerated the snapshotgit.status=dirtymeans the worktree has uncommitted changes; it does not automatically prove that the snapshot fingerprint changed
Retrieval Workflow
For read:
- Inspect
files,snippets,flowAnchors,nextHops, andsearchScope - Read suggested files directly when possible
- Only widen to repo search if the payload is insufficient
- Exclude
repo/progress/,node_modules/,dist/,build/, and__pycache__/when widening search
For report:
- Inspect
coreFiles,snippets,flowAnchors, andrecommendedReportShape - If the host supports subagents, pass the
deep-packthere - Stop at the pack boundary on the parent thread when delegation is available
- Fall back to same-thread deep reporting only when delegation is unavailable
Query Guidance
For focused questions, prefer --task with a UTF-8 safe query channel.
On Windows or any environment where non-ASCII query text may become mojibake:
- Prefer
--query-escaped <ascii_only_query> - Then
--query-file <utf8_file> - Then
--query-stdin - Avoid raw
--queryfor non-ASCII input when the shell is unreliable
Manual Script Usage
Replace {skill_dir} with the actual installed skill path. In this repository,
that path is miloya-codebase/.
python {skill_dir}/scripts/generate.py <project_path>
python {skill_dir}/scripts/generate.py <project_path> --force
python {skill_dir}/scripts/generate.py <project_path> --read
python {skill_dir}/scripts/generate.py <project_path> --read --task feature-delivery --query "skill lifecycle runtime"
python {skill_dir}/scripts/generate.py <project_path> --read --task feature-delivery --query-escaped "\\u6280\\u80fd\\u7ba1\\u7406\\u5668\\u5982\\u4f55\\u5b9e\\u73b0"
python {skill_dir}/scripts/generate.py <project_path> --read --task feature-delivery --query-file query.txt
python {skill_dir}/scripts/generate.py <project_path> --report --task feature-delivery --query "skill download flow"
cat query.txt | python {skill_dir}/scripts/generate.py <project_path> --read --task feature-delivery --query-stdin
Windows-safe example:
python {skill_dir}/scripts/generate.py <project_path> --read --task feature-delivery --query-escaped "\\u6280\\u80fd\\u4e0b\\u8f7d\\u6d41\\u7a0b"
References
Read these only when needed:
- references/snapshot-schema.md
- read when you need field-level snapshot or retrieval payload details
- references/response-contract.md
- read when you need the full presentation contract for overview or read-mode outputs
- references/deep-pack.md
- read when you need the
reportprotocol, host delegation rules, or deep-pack fields
- read when you need the
Core Rules
- Exclude generated/vendor noise such as
.git,node_modules,dist,build,__pycache__, andrepo/progress - Avoid self-referential scans of the skill's own output
- Prefer cached artifacts over rescanning whenever the mode allows it
- Use
readfor focused retrieval andreportfor deep-pack generation - Keep the parent thread lightweight in
reportmode when delegation exists
More from jochenyang/jochen-ai-rules
ui-ux-pro-max
UI/UX design-system reasoning and UX quality audit skill. Use when user needs style direction, palette/typography selection, UX review, or design optimization before implementation. Do NOT use for backend logic or database design.
24devops-engineer
CI/CD pipeline design, containerization, and infrastructure management. Handles Docker, Kubernetes, monitoring setup (Prometheus/Grafana), and infrastructure-as-code (Terraform/Pulumi). Use when user asks to deploy, configure CI/CD, set up Docker/K8s, or manage infrastructure.
19handoff
Create and resume structured manual session handoffs for long-running development work. Use when approaching context limits, before manual reset, before switching models or IDEs, after a milestone, or when automatic compact would lose important implementation state.
1reflect
Review current conversation, analyze tasks, errors, and user feedback, extract learning opportunities for skill improvement. Use when user says "reflect", "review session", "what did we learn", "session summary", or after completing a complex task.
1developer
Comprehensive full-stack development for web, mobile, and game projects. Handles frontend (React/Vue/Angular), backend (Node.js/Python/Go/Java), mobile (Flutter/React Native/Swift/Kotlin), and game development (Unity/Unreal/Godot). Use when user asks to build, create, develop, implement, debug, or fix any web, mobile, or game project. Do NOT use for design-only tasks (use frontend-design or ui-ux-pro-max instead).
1mcp-builder
MCP server development for AI agents. Designs tool schemas, implements Python/TypeScript servers, creates evaluation tests. Use when user asks to build MCP server, create tool integration, or develop Claude plugins. Supports GitHub/Notion/Slack integrations.
1