Skip to content

Commit 899ce41

Browse files
committed
docs: add F-Stack dev-rule, issue-process, and info-search skills (zh/en)
Add three CodeBuddy skills covering mandatory development rules, the issue analysis SOP, and information search, in both Chinese (docs/zh_cn/skills/) and English (docs/skills/).
1 parent 15e38e0 commit 899ce41

6 files changed

Lines changed: 866 additions & 0 deletions

File tree

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
name: f-stack-dev-rule
3+
description: Mandatory development rules for the F-Stack project (zero tolerance). Covers: shell operations must go through rm_tmp_file.sh / kill_process.sh / chmod_modify.sh scripts, make clean before full rebuild after code changes, local config.ini test values must not be committed, no real IPs in docs (use placeholders), English commit messages (1-3 sentences), English-only short comments in F-Stack code, minimal comments in lib/, multi-agent collaboration rules (write/review separation, bounce<=3, leader polling without early exit), no speculation without actual execution (code is authoritative), and all question/analysis/research tasks must use the f-stack-info-search skill. Use this skill for any development, debugging, testing, or commit task in the /data/workspace/f-stack workspace.
4+
---
5+
6+
# F-Stack Mandatory Development Rules
7+
8+
This skill is a collection of mandatory rules for all development tasks in the /data/workspace/f-stack workspace. Violating any of them causes the task to be bounced back for correction. Zero tolerance.
9+
10+
## 1. Shell Operation Script Rules
11+
12+
Direct invocation of rm / kill / chmod command families is forbidden. Always use the following scripts:
13+
14+
### 1.1 Delete files -> /data/workspace/rm_tmp_file.sh
15+
16+
- Single file: `/data/workspace/rm_tmp_file.sh /full/path/to/file`
17+
- Multiple files: `/data/workspace/rm_tmp_file.sh /path/a /path/b`
18+
- Directory: `/data/workspace/rm_tmp_file.sh /full/path/to/dir`
19+
- Trash location: `/tmp/.trash` (keeps the path prefix for traceability)
20+
- Permanent purge: `/data/workspace/rm_tmp_file.sh --purge <trash_path> [--older-than Nd] [--dry-run]` (purge whitelist is only /tmp/.trash, /data/.Trash-0/files, /data/.Trash-0/info)
21+
- Forbidden: direct `rm`, `rm -rf`, `find -delete`, or embedding rm inside bash snippets
22+
- Bulk deletion of *.o etc.: first collect absolute paths with `ls`/`find`, then pass them all to the script at once
23+
24+
### 1.2 Stop processes -> /data/workspace/kill_process.sh
25+
26+
- Single PID: `/data/workspace/kill_process.sh <pid>`
27+
- Multiple PIDs: `/data/workspace/kill_process.sh <pid1> <pid2>`
28+
- Forbidden: `kill`, `pkill`, `killall`, `kill -9`, `pgrep | xargs kill`, kill embedded in trap/cleanup, or any other form
29+
30+
### 1.3 Change permissions -> /data/workspace/chmod_modify.sh
31+
32+
- Usage: `/data/workspace/chmod_modify.sh <mode> <path1> <path2> ...` (mode is compatible with chmod(1), octal or symbolic)
33+
- Forbidden: direct `chmod`, `chmod -R`, `install -m`, `setfacl`, or any other form
34+
- Note: the script snapshots pre-change permissions to /tmp/.trash/, audits to /data/workspace/.chmod_audit.log, refuses high-risk paths, and warns on setuid/setgid bits
35+
36+
### 1.4 General rules
37+
38+
- make clean / make install and other build-system targets are build tool operations and may run directly
39+
- If a script lacks a needed feature (e.g. --reference=), extend the script first, then use it; no temporary bypasses allowed
40+
41+
## 2. Build Rules
42+
43+
- After modifying any .c/.h file, run `make clean` (or an equivalent full-clean target) before a full rebuild; incremental builds are forbidden
44+
- Header changes affect every translation unit that includes them; clean is required even for a single-file change
45+
- Build verification is only valid with a clean build; a passing incremental build is not evidence
46+
- After modifying a common header, verify every file that includes it still compiles; a full make with no errors is required before a PR
47+
- Two known local build pitfalls and their workarounds:
48+
- The IDE-injected safe-delete hook blocks the rm inside make clean: use `PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin" make clean`
49+
- `make -j16` races with machine_includes: run `make machine_includes` first, then `make -j16`
50+
- Baseline reference: lib builds with error 0 / warning 51 (existing baseline; new changes must not add warnings)
51+
52+
## 3. config.ini Rules
53+
54+
- For config.ini and similar committed config files, only changes directly related to the current feature may be committed
55+
- Never commit local test/debug environment tweaks: lcore_mask, vlan_filter, idle_sleep, real local IPs in [portN], temporary perf-tuning values, etc.
56+
- Always review `git diff` item by item before `git add config.ini`
57+
- Never restore local test values with `git checkout config.ini` (local config is required for local runs and must be kept)
58+
- Correct approach: do not select config.ini in git add; leave local test values in the unstaged area
59+
60+
## 4. No Real IPs in Docs
61+
62+
- Never record real IPs of the local runtime environment in any document (docs, README, spec, test reports, execution logs, commit messages, PR comments, etc.)
63+
- Use descriptive placeholders: `<DPDK_NIC_IP>`, `<DPDK_NIC_IPV6>`, `<KERNEL_NIC_IP>`, `<CLIENT_IP>`, `<CLIENT_IPV6>`, `<GATEWAY_IP>`, `<GATEWAY_IPV6>`, `<BROADCAST_IP>`, `<NETWORK_PREFIX>`, `<VIP_IPV6>`, `<BACKEND_IPV6>`, etc.
64+
- Generic forms (e.g. 9.134.x) are allowed; complete real addresses are forbidden
65+
- `127.0.0.1` and `fe80::` link-local addresses may be written
66+
67+
## 5. Commit Rules
68+
69+
- Commit messages are always in English, 1-3 short sentences, no long essays
70+
- Local config.ini test values must not be committed (see section 3)
71+
- Fixing an accidental commit uses forward-fix (a new commit to roll back), never rewriting history
72+
73+
## 6. Code Comment Language Rules
74+
75+
- F-Stack project (/data/workspace/f-stack, including all code files under lib/, freebsd/, example/, tests/, etc.): comments and git commit messages must use short English; Chinese is forbidden
76+
- Documentation files (docs/*.md, Chinese spec docs) are exempt and follow the required document language
77+
78+
## 7. Minimal Comments in lib/
79+
80+
- Only add comments where truly necessary: public interface contracts (e.g. ff_api.h), config item meanings (e.g. config.ini), and genuinely complex/non-obvious algorithms or edge handling
81+
- Never comment self-evident code (simple assignments, obvious branches, self-explanatory calls)
82+
- Even for complex logic, keep comments concise; prefer clear naming and structure for self-explanatory code
83+
84+
## 8. Multi-Agent Collaboration Rules
85+
86+
Applies to harness-engineering + multi-agent (agent team / spec-driven) tasks:
87+
88+
- **Leader must not exit early**: the leader must not end the task before every sub-agent reports its final result; actively poll and wait
89+
- **Sub-agent timeout detection**: no unbounded waiting; side-channel probing (reading written files, git status, artifacts) takes priority over message probing
90+
- **Write/review separation**: writing code/docs and reviewing must be done by different agents; the leader must never write and review its own work; pure research/probing/summarizing single-role tasks may be done by the leader
91+
- **bounce<=3**: any stage-gate failure must bounce back to the previous step for a fix, never ship with known failures; after 3 bounces on one step, stop immediately and escalate to a human decision
92+
- **Failure fallback**: on sub-agent timeout/stall/verdict conflict, the leader may take over or spawn a new agent to redo it, without violating write/review separation
93+
94+
## 9. No Speculation Rules
95+
96+
- All actions must actually be executed; never give results based on guesswork without execution
97+
- Cross-verify code/docs/external data sources; where they conflict, the actual code is authoritative
98+
- Items that cannot be statically verified or where the environment is insufficient must be honestly marked "unverified/not executed"; never assert PASS by assumption
99+
100+
## 10. Information Search Rules
101+
102+
- All question/analysis/research tasks must use the **f-stack-info-search** skill to search for information
103+
- Coverage: issue analysis, bug location, feature research, information gathering before design, technical Q&A, and any other scenario requiring research
104+
- Follow the five parts of f-stack-info-search: architecture docs and knowledge graph -> commit history -> related issues/PRs -> public resources -> internal/external websites, blogs, WeChat articles, etc.
105+
- Cross-validation: converge evidence from internal docs + external resources + actual code/testing; where they conflict, the actual code is authoritative
106+
- Never answer or conclude based on guesswork without searching
107+
108+
## 11. Runtime Test Environment
109+
110+
- This machine has two NICs: the DPDK-exclusive NIC and eth1 are different cards
111+
- Testing DPDK NIC programs: access the DPDK-managed NIC on this machine from the peer via `ssh f-stack-client` (use the `<DPDK_NIC_IP>` placeholder)
112+
- Testing the kernel stack on this machine: use 127.0.0.1 on lo
113+
- Stop processes via kill_process.sh, clean temp files via rm_tmp_file.sh, restore config.ini temp test values after testing, and never commit them
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
---
2+
name: f-stack-info-search
3+
description: F-Stack information search skill. Use when gathering evidence for issue analysis, bug location, or feature research in the F-Stack/f-stack repository. Contains five parts: check project architecture docs and knowledge graph (three-layer architecture docs LAYER1/2/3 and KNOWLEDGE_GRAPH_WIKI under docs/), check commit history (local git log search for fixing commits + DPDK upstream), check related Issues and PRs (first check the local issue analysis archives docs/f-stack-issue-ana.md and docs/zh_cn/f-stack-issue-ana.md, then gh search issues/prs + DPDK Patchwork), check public resources (DPDK Bugzilla/Patchwork/inbox.dpdk.org/web search), and internal/external information search for general analysis and research tasks (tech blogs/WeChat articles/tech communities/internal knowledge bases/iWiki, bilingual keyword construction and three-way evidence convergence). Invoked by the search step of the f-stack-issue-process skill; can also be used standalone. Trigger words: check commit history, search for information, check related issues, check public resources, git log search, gh search, architecture docs, knowledge graph, research information.
4+
---
5+
6+
# F-Stack Information Search Skill
7+
8+
Gather evidence for F-Stack issue analysis, bug location, and feature research. Invoked by the search step of the f-stack-issue-process skill; can also be used standalone.
9+
10+
## Environment Preparation
11+
12+
- GitHub Token configured (GH_TOKEN environment variable)
13+
- Official F-Stack repository cloned to /data/workspace/f-stack
14+
- gh CLI installed
15+
16+
## Part 1: Check Architecture Docs and Knowledge Graph
17+
18+
Before searching code, first consult f-stack's existing three-layer architecture docs and knowledge graph (`/data/workspace/f-stack/docs/`) to quickly locate the layers, modules, interfaces, and functions involved, narrowing the later search scope.
19+
20+
Three-layer architecture docs (bilingual, identical content):
21+
22+
- Layer1 system overview: `01-LAYER1-ARCHITECTURE.md` (Chinese) / `F-Stack_Architecture_Layer1_System_Overview.md` (English)
23+
- Layer2 interface specification: `02-LAYER2-INTERFACES.md` (Chinese) / `F-Stack_Architecture_Layer2_Interface_Specification.md` (English)
24+
- Layer3 function index: `03-LAYER3-FUNCTIONS.md` (Chinese) / `F-Stack_Architecture_Layer3_Function_Index.md` (English)
25+
26+
Knowledge graph:
27+
28+
- `KNOWLEDGE_GRAPH_WIKI.md`: knowledge graph wiki
29+
- `F-Stack_Knowledge_Base_Summary.md`: knowledge base overview
30+
31+
Usage:
32+
33+
- Locate the involved layers and components (e.g. protocol stack layer, DPDK abstraction layer, interface layer) by keyword/module name in the architecture docs
34+
- Use the knowledge graph to locate related code paths and functions, then narrow the git log / gh search scope accordingly
35+
- The Chinese and English content is identical; consult either language
36+
37+
## Part 2: Check Commit History
38+
39+
Search for related fixes in the local F-Stack repository.
40+
41+
```bash
42+
cd /data/workspace/f-stack
43+
44+
# Search commit messages by keyword
45+
git log --all --oneline --grep='<keyword>'
46+
47+
# Search change history by file path
48+
git log --all --oneline -- <file path>
49+
50+
# Search for fixing commits
51+
git log --all --oneline --grep='fix' --grep='<keyword>' --all-match
52+
53+
# View the details of a commit
54+
git show <commit-hash>
55+
```
56+
57+
Also check f-stack's own modifications to DPDK (the local dpdk/ directory is a plain directory inside the f-stack repository with **no DPDK upstream commit history**; git log can only find f-stack's own few modifications):
58+
59+
```bash
60+
# f-stack's own modifications to dpdk/ (not upstream commits)
61+
git log --all --oneline -- dpdk/
62+
git show <commit-hash>
63+
```
64+
65+
Checking DPDK upstream fixes must go through external channels (no upstream history locally):
66+
67+
```bash
68+
# Search fixing commits in the official DPDK repository
69+
gh search commits '<keyword>' -R DPDK/dpdk --limit 20
70+
```
71+
72+
Or use the DPDK Patchwork API (see Part 3), DPDK Bugzilla/mailing lists (see Part 4).
73+
74+
Points of interest:
75+
76+
- Whether DPDK upstream has fixing commits (Fixes/fix/patch) after the version mentioned in the issue
77+
- Whether the fix has been backported to the version in use (F-Stack currently uses DPDK 24.11.6)
78+
- Whether f-stack's dpdk/ has a corresponding local patch or a missed port
79+
80+
## Part 3: Check Related Issues and PRs
81+
82+
First check the local issue analysis archives (highest priority, avoid re-analyzing):
83+
84+
- Chinese: docs/zh_cn/f-stack-issue-ana.md
85+
- English: docs/f-stack-issue-ana.md
86+
87+
When looking for similar issues, first search these two archives for existing analysis records (issue number, keyword, error symptom). If found, cite the existing conclusion directly; if not, analyze and supplement. The Chinese and English archives stay in sync.
88+
89+
```bash
90+
export GH_TOKEN='<token>'
91+
92+
# Search related issues (open + closed)
93+
gh search issues '<keyword>' -R F-Stack/f-stack --limit 20
94+
95+
# Search related PRs (especially merged ones)
96+
gh search prs '<keyword>' -R F-Stack/f-stack --limit 20
97+
98+
# View a specific PR
99+
gh pr view <NUMBER> -R F-Stack/f-stack
100+
101+
# View a PR's diff
102+
gh pr diff <NUMBER> -R F-Stack/f-stack
103+
```
104+
105+
DPDK upstream Patchwork (when tracking upstream patches):
106+
107+
- API: `https://patches.dpdk.org/api/patches/?q=<keyword>`
108+
- Fetch with the WebFetch tool
109+
110+
## Part 4: Check Public Resources
111+
112+
Search the following sources by priority:
113+
114+
1. DPDK Bugzilla: https://bugs.dpdk.org
115+
2. DPDK Patchwork: https://patches.dpdk.org
116+
3. DPDK mailing list archive: https://inbox.dpdk.org (prefer the API to avoid the Anubis bot)
117+
4. Web search: Stack Overflow, CSDN, GitHub global search
118+
119+
Note: sites like lore.kernel.org may be blocked by the Anubis bot; prefer API endpoints or inbox.dpdk.org.
120+
121+
## Part 5: Internal/External Information Search for General Analysis and Research Tasks
122+
123+
For general tasks such as issue analysis, bug location, and feature research, after completing the previous four parts, further search internal and external resources such as tech websites, blogs, and WeChat articles for cross-validation and background.
124+
125+
### 5.1 Search goals
126+
127+
- Existing analysis and solutions for similar problems (pitfalls others hit, fix ideas)
128+
- Explanations and implementation details of related features (to understand the design intent)
129+
- Upstream/community discussion and handling of the problem
130+
- Industry best practices and performance data (for design reference)
131+
132+
### 5.2 Search channels (by priority)
133+
134+
1. External technical resources (web_search / web_fetch):
135+
- GitHub issues / wiki / discussions (F-Stack, DPDK, FreeBSD upstream repositories)
136+
- Tech blogs and personal sites (e.g. medium, dev.to, personal tech blogs)
137+
- Tech communities (Stack Overflow, Server Fault, Unix & Linux SE, CSDN, Zhihu, Juejin, SegmentFault)
138+
- WeChat official account articles (search on weixin.sogou.com, then web_fetch the article body)
139+
2. Internal knowledge bases (RAG_search, if enterprise knowledge bases are connected): search internal best practices, historical handling records, and internal component docs
140+
3. Tencent internal iWiki (if iWiki documents are involved, use the iwiki-doc skill to search docs, spaces, and directory trees on iwiki.woa.com)
141+
142+
### 5.3 Keyword construction
143+
144+
- Search in both Chinese and English, one round each; construct Chinese and English keywords separately
145+
- Combinations: `<tech term> + <version>` (e.g. "DPDK 24.11 RSS hash"), `<exact error message>` (pasting the original log/error text gives the highest hit rate), `<function name> + <symptom>` (e.g. "rte_thash_adjust_tuple misqueue"), `<issue title keyword> + fix/regression`
146+
- Add qualifiers: `site:github.com`, `site:stackoverflow.com`, `inurl:blog`, etc.
147+
- Mind version timeliness: prefer resources close in time to the version in use (F-Stack v2.0 / DPDK 24.11.6 / FreeBSD 15.0) to avoid outdated conclusions
148+
149+
### 5.4 Cross-validation and evidence convergence
150+
151+
- Three-way evidence convergence: internal docs + external resources + actual code/testing, mutually confirming
152+
- External conclusions must be checked against the local actual code; **where they conflict, the actual code is authoritative**
153+
- Mark external resources with source and publication time; conclusions from a single source are marked "only this source, not double-verified"
154+
- Honestly mark what cannot be verified as "unverified/not executed"; never speculate
155+
156+
## Search Output Requirements
157+
158+
- For each source, give the query terms and a summary of hits, with concrete links or commit hashes
159+
- Cross-validation: converge evidence from code/docs/external data sources; where they conflict, the actual code is authoritative
160+
- Honestly mark items that cannot be verified or where the environment is insufficient as "unverified/not executed"; never speculate
161+
- Never include real IPs in the output (use placeholders like `<DPDK_NIC_IP>`)

0 commit comments

Comments
 (0)