Required reading at startup
Before making any judgment or taking any action, first check .codestable/attention.md: if it exists, read it; if .codestable/ is missing, prompt the user to first run cs-onboard; only when attention.md is missing may this skill first create the fixed section skeleton and then write. Do not fall back to external AI entry files.
cs-keep produces an independent markdown file to .codestable/compound/,retrieved via grepis read;.codestable/attention.md is themandatory required readingcontext at CodeStable skill startup. These two types of information have different destinations—this skill specifically handles the latter: appending "short, stable, must-know-every-time" fragments to the attention file.
Does not replace cs-keep; it is another entry point.
What goes into cs-note and what does not
Criteria: length + frequency + stability—only if all three pass does it go to cs-note.
| Item | Goes to cs-note | Goes elsewhere |
|---|---|---|
| Length | Can be explained in one or two lines | More than half a screen / requires expanded background → cs-keep |
| Frequency | Useful in almost every session | Only relevant to a specific type of task → cs-keep |
| Stability | Hard constraint in effect for the project long term | Temporary bypass / short-term workaround → write to the issue spec or feature spec |
| Decision status | Already an established fact (no decision record needed) | Need to record rationale for a choice / rejected option → cs-keep |
✅ Typical things that should go in:
- "Compilation must first
pnpm run gengenerate schema" - "Before starting the service locally, you must
docker compose up redis" - "The project uses yarn berry,do notuse
npm install" - "The test command is
bun test, notnpm test" - "src/legacy/ is historical code, ask before changing it"
- "
OPENAI_KEYgo through 1Password, do not copy from .env.example"
❌ Typical things that should not go in(would make attention.md bloated):
- The fix for a certain bug (→ cs-keep)
- How to use a certain library (→ cs-keep)
- A piece of architecture description (→ cs-domain starts an ADR)
- Short-term status like "doing X this week" (→ do not record, it will expire)
- Things that need 3 or more lines to explain clearly (→ cs-keep)
If you cannot judge clearly, ask the user one question: "Does this need to be known by AI in every future session?" If the answer is "not necessarily" → it is not cs-note.
Target file
The target file is fixed as .codestable/attention.md. No longer compatible with AGENTS.md / CLAUDE.md / .cursorrules and other external AI tool entry points.
.codestable/does not exist → this repository has not yet integrated CodeStable, first prompt the user to runcs-onboard.codestable/attention.mddoes not exist → treat it as a missing skeleton, first create the minimal skeleton and then writeAGENTS.md/CLAUDE.mdeven if it exists, do not read, do not write, do not ask about user preferences
attention.md is CodeStable's own entry point for startup notices; its value comes from all CodeStable skills explicitly requiring that it be read, rather than relying on automatic injection by external tools.
Fixed section structure
To prevent the file from bloating into another fat file, the sectionsare hardcodedGroup one (items not in the list do not start a new section):
## 项目碎片知识
<!-- cs-note managed: 用 cs-note 维护,新条目按下面分节追加 -->
### 编译与构建
### 运行与本地起服务
### 测试
### 命令与脚本陷阱
### 路径与目录约定
### 环境变量与凭证
### 其他
Rules:
- New entries are appended to the end of the corresponding section, one line each (two lines max)
- No suitable section → go to "Other". If "Other" exceeds 5 entries, stop and discuss with the user whether to add a fixed section (do not silently add sections)
- When a section is empty, keep the whole block, do not delete it (so the AI can see that this section is meaningful)
- Comment line
<!-- cs-note managed -->is the recognition anchor for this skill—if it cannot be found, insert the whole block structure at the end of the file - Soft upper limit for the whole block is ~150 lines—if exceeded, prompt the user: "There is too much fragmented knowledge, pick a few entries to sink into cs-keep?"
Process
1. Determine whether it should go in
Check against the "Criteria" table above. If any item fails → guide to the corresponding other skill, and this round ends.
2. Confirm the attention file
Check .codestable/attention.md. If .codestable/ is missing, stop and prompt to first cs-onboard; if only attention.md is missing, create this skill's fixed section skeleton.
3. Find the location: section categorization + duplicate check
- Read
.codestable/attention.md, find the<!-- cs-note managed -->anchor to locate - If the anchor cannot be found → append the whole "Project Fragmented Knowledge" skeleton at the end of the file
- Grep keywords within the "Project Fragmented Knowledge" section to check for duplicates—when a similar entry already existsdo not start another entry, ask the user "should the existing one be updated, or is this really a separate entry?"
- Choose the section; if there is no suitable section, go to "Other"
4. Write one entry in
Format for each entry:
- {一句话事实 + 必要时一句话原因}
Example:
- 编译前要先 `pnpm run gen`,否则 schema 类型对不上
- 别用 `npm install`,项目锁文件是 yarn berry 的
- src/legacy/ 是 2023 前的老代码,改之前先和 @ldz 确认
After writing, once the user reviews and confirms with one sentence, exit.Do not proactively write multiple entries in a row—one at a time, to avoid casually stuffing in ones that have not been decided.
5. Trigger the soft upper limit check
After writing, check the total line count of the "Project Fragmented Knowledge" section:
- ≥150 lines → prompt the user to pick a few entries to sink into cs-keep
- "Other" section ≥5 entries → prompt the user to discuss whether to add a fixed section
Justprompt, do not decide for the user.
Timing for proactive recommendations
Do not ask every time. Only push one sentence when two clear signals trigger it:
- The user says a fact in the conversation that clearly belongs to fragmented knowledge—"Oh right, for this project you have to do X first before Y", "For us, use Z, not W"—push: "Should this one be
cs-note? Then the AI can see it every time from now on." - The AI itself just hit a project-specific setting that can be explained in one sentence(build failure / wrong command / wrong path)—after fixing, push: "Is this pitfall common to the project? If so,
cs-notenote it down, and the next session will know it directly."
If the user says "no need", skip immediately and do not push again.
Easy pitfalls
- Stuffing detailed background / multi-step guides into attention.md—if it exceeds two lines, it should go to cs-keep
- Writing to
AGENTS.md/CLAUDE.md—CodeStable no longer supports these external entry points - Silently adding sections—sections are hardcoded, and adding one must first be discussed with the user
- Seeing one entry and then writing several others along with it—one at a time
- Writing "short-term status" (doing X this week / this sprint's goal) — it expires but no one deletes it, so it gradually becomes misleading
- Appending without deduplicating — after the same fact is recorded 3 times, the AI instead can't tell which one is accurate