Positioning
Optional Phase 0. Before the main process (Phase 1-9) starts, the user can proactively trigger this skill to check whether the current working environment meets the requirements. It is not in the main process and does not block any phase.
Use cases:
- When using arkweb-sdd for the first time
- When switching to a new machine/new project
- When a data source is unavailable during workflow execution
- When you want to confirm the current environment capability level
Check Process
Step 0: Determine the project root directory
1. 确认当前工作目录(cwd)
2. 检查 skills/arkweb-architect/SKILL.md 是否存在
- 存在 → 当前目录即为项目根(SKILL_HOME)
- 不存在 → 提示用户指定项目根目录,或 clone arkweb-sdd
Step 1: Required item check (if not satisfied, the main process cannot be started)
| # | Check item | Detection method | Automatic fix | When fix fails |
|---|---|---|---|---|
| P-1 | Skill files complete | Check skills/ whether the 11 core SKILL.md files exist |
Prompt the user to copy the missing files from arkweb-sdd | List the missing skills; some parts of the main process may be unavailable |
| P-2 | Artifact directory writable | mkdir -p docs/features/test && rm -rf docs/features/test |
Automatically create docs/features/、analysis/ |
Prompt the user to check directory permissions |
| P-3 | Template files exist | Check assets/templates/ the 6 templates |
Prompt to copy from arkweb-sdd | List the missing templates; the design document phase may lack template guidance |
| P-4 | AI Agent capability detection | Detect sessions_spawn whether available |
If unavailable, switch toMode B (serial) | Inform the user that serial mode will be used and the expert team cannot run in parallel |
Step 2: Enhancement item check (if not satisfied, it can be degraded; does not affect startup)
| # | Check item | Detection method | Degradation plan |
|---|---|---|---|
| E-1 | GitCode API Token | Read the environment variable (prefer GITCODE_TOKEN, fall back to GITLAB_TOKEN) or the .env file |
Prompt the user to configure; Phase 9 (submit PR) needs manual handling |
| E-2 | oh-chromium-knowledge knowledge base | curl -s -H "PRIVATE-TOKEN: $TOKEN" "https://gitcode.com/api/v5/repos/{owner}/{knowledge_repo}/contents/index.json" Check HTTP 200 |
code-analysis degrades to DeepWiki priority |
| E-3 | oh-ai-full-design knowledge base | Check in the same way as above openharmony-ai-design/oh-ai-full-design |
No permission is normal; code-analysis skips this data source |
| E-4 | DeepWiki MCP | Try calling the MCP tool, or check common MCP configuration files (opencode.json / claude_desktop_config.json / cursor mcp.json, etc.) | Degrade to the agent-browser method or skip DeepWiki |
| E-5 | agent-browser skill | Check whether the skill file exists | DeepWiki degrades to unavailable; code-analysis relies on local documents |
| E-6 | Reference documents | Check references/ the files under |
Each skill automatically skips them when referencing reference documents; does not affect the main process |
Step 3: Environment capability rating
Based on the check results, output the capability level of the current environment:
| Level | Conditions | Capabilities |
|---|---|---|
| 🟢 Complete | All required items + 3 or more enhancement items pass | Complete subagent orchestration + knowledge base + MCP + PR automation |
| 🟡 Standard | All required items pass + some enhancement items | Subagent orchestration + some data sources, some stages require manual operation |
| 🟠 Basic | Required items pass + no enhancement items | Serial mode + local documents, no knowledge base enhancement |
| 🔴 Unavailable | Required items do not pass | Requires repair before retry |
Step 4: Automatic repair (executed for repairable items)
The following items can be repaired directly by AI; confirm with the user before repairing:
| Repair item | Operation |
|---|---|
| Create missing directory | mkdir -p docs/features/ analysis/ references/ assets/templates/ |
| Generate .env template | Create .env file (GITCODE_TOKEN=你的Token), prompt the user to fill it in |
| Generate MCP configuration template | Generate the corresponding MCP configuration based on the AI tool the user is using (OpenClaw / Cursor / Claude Desktop / opencode, etc.), and prompt the user to confirm |
| Detect operating mode | Automatically set Mode A or Mode B |
Step 5: Output environment report
# 🔍 ArkWeb SDD 环境预检报告
**项目根目录**: /path/to/project
**检查时间**: YYYY-MM-DD HH:MM
**环境等级**: 🟢 完整 / 🟡 标准 / 🟠 基础
## 必须项(P-1 ~ P-4)
| # | 检查项 | 状态 | 说明 |
|---|--------|------|------|
| P-1 | Skill 文件 | ✅/❌ | 11/11 完整 / 缺少: xxx |
| P-2 | 产出物目录 | ✅/❌ | 自动创建完成 |
| P-3 | 模板文件 | ✅/❌ | 6/6 完整 / 缺少: xxx |
| P-4 | Agent 能力 | ✅ 模式A / ⚠️ 模式B | subagent 可用 / 串行模式 |
## 增强项(E-1 ~ E-6)
| # | 检查项 | 状态 | 降级方案 |
|---|--------|------|---------|
| E-1 | GitCode Token | ✅/⚠️ | 已配置 / Phase 9 需手动 |
| E-2 | chromium-knowledge | ✅/⚠️/❌ | 可访问 / 无Token / 降级DeepWiki |
| E-3 | oh-ai-full-design | ✅/⚠️ | 可访问 / 无权限(正常) |
| E-4 | DeepWiki MCP | ✅/⚠️ | 可用 / 降级浏览器或跳过 |
| E-5 | agent-browser | ✅/⚠️ | 可用 / 跳过DeepWiki浏览器方式 |
| E-6 | 参考文档 | ✅/⚠️ | 文件完整 / 部分缺失 |
## 自动修复记录
- [x] 创建 docs/features/ 目录
- [x] 创建 analysis/ 目录
- [ ] .env 模板已生成,请填入 GITCODE_TOKEN 或 GITLAB_TOKEN
## 数据源优先级(基于当前环境)
code-analysis 将使用:🥇 xxx → 🥈 xxx → 🥉 xxx
## 建议
- (如果环境不是 🟢 完整,列出改进建议)
Position in the main workflow
Phase 0 (可选) ─ preflight 环境检查
│ 用户主动触发,非必须
▼
Phase 1 ─ proposal(需求录入)
│ 主流程开始
▼
... Phase 2-9 ...
Trigger methods:
- The user says "check environment"/"preflight"/"help me check the configuration"
- AI proactively asks "Do you need to check the environment?" before the main workflow Phase 1 begins
Cases where it is not triggered:
- The user directly says "start requirements analysis" → skip Phase 0 and go directly to Phase 1
- The user explicitly says "skip the check" → ignore
Integration with architect
In arkweb-architect/SKILL.md before Phase 1, optionally add:
### Phase 0(可选): 环境预检
当用户首次使用、切换环境、或主动要求时,读取 `.skills/arkweb-preflight/SKILL.md` 执行环境检查。
主 Session:
1. 询问用户"是否需要检查工作环境?"
2. 用户确认 → 读取 preflight skill 并执行检查
3. 用户跳过 → 直接进入 Phase 1
Notes
- Do not modify the workflow of any existing skill, only serve as an optional prerequisite
- Check resultsare not used as a gate, the user can ignore warnings and start the main workflow directly
- Automatic repair operations requireuser confirmationbefore being executed
- The environment report is saved in the project root directory
preflight-report.md(optional)