@pigcloud/skills 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -28
- package/README.en.md +4 -3
- package/README.md +37 -35
- package/bin/cli.js +98 -71
- package/package.json +69 -69
- package/rules/coding/implementation.md +6 -5
- package/rules/product/project-context.md +6 -5
- package/rules/skill-profile-map.json +6 -5
- package/rules/skill-profile-map.md +6 -5
- package/scripts/ci-validator.sh +19 -19
- package/scripts/validate-skill-shapes.js +5 -4
- package/scripts/validate-skills.ps1 +6 -6
- package/scripts/validate-skills.sh +5 -5
- package/skills/{api-docs → api-contract-docs}/SKILL.md +5 -4
- package/skills/{extract-business-facts → business-fact-extraction}/SKILL.md +9 -8
- package/skills/{extract-business-facts → business-fact-extraction}/scripts/write-knowledge-base.js +4 -3
- package/skills/code-review/SKILL.md +7 -6
- package/skills/domain-modeling/SKILL.md +4 -3
- package/skills/feature-build/SKILL.md +10 -10
- package/skills/feature-build/references/comment-specification.md +1 -1
- package/skills/knowledge-capture/SKILL.md +1 -1
- package/skills/{performance-check → performance-audit}/SKILL.md +5 -4
- package/skills/project-bootstrap/SKILL.md +3 -2
- package/skills/references/business-fact-extraction.md +9 -8
- package/skills/references/engineering-delivery-method.md +4 -3
- package/skills/references/engineering-delivery-template.md +3 -2
- package/skills/references/golden-prompt-suite.js +44 -43
- package/skills/references/project-requirement-alignment.md +2 -1
- package/skills/references/rule-loading-map.md +4 -3
- package/skills/references/skill-authoring-standard.md +4 -3
- package/skills/references/skill-reference-matrix.md +15 -14
- package/skills/{security-review → security-audit}/SKILL.md +4 -2
- package/skills/{spec → spec-refinement}/SKILL.md +19 -18
- package/skills/technical-design/SKILL.md +11 -10
- package/skills/test-design/SKILL.md +2 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
# Coding Implementation Rules
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 榛樿鍋氭硶
|
|
4
4
|
|
|
5
5
|
- Implement only the confirmed scope.
|
|
6
6
|
- Keep the change small, reviewable, and verifiable.
|
|
7
7
|
- Preserve the agreed boundary while coding.
|
|
8
8
|
- Prefer one implementation path over speculative alternatives unless the task explicitly asks for options.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 绂佸尯
|
|
11
11
|
|
|
12
|
-
- Do not rewrite the spec while implementing.
|
|
12
|
+
- Do not rewrite the spec-refinement while implementing.
|
|
13
13
|
- Do not widen the scope because implementation is difficult.
|
|
14
14
|
- Do not skip validation.
|
|
15
15
|
- Do not bundle unrelated cleanup into the same change unless it reduces risk.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## 妫€鏌?
|
|
18
18
|
|
|
19
19
|
- Does the code stay within scope?
|
|
20
20
|
- Can the result be validated locally?
|
|
21
21
|
- Is the implementation easy to review in one pass?
|
|
22
22
|
- Would the diff still make sense if the task title were removed?
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## 鍥炴斁淇″彿
|
|
25
25
|
|
|
26
26
|
- Trigger when the request is about delivery, refactor, or code changes.
|
|
27
27
|
|
|
28
28
|
## References
|
|
29
29
|
|
|
30
30
|
- `coding/index.md`
|
|
31
|
+
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
# Project Context Rules
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 榛樿鍋氭硶
|
|
4
4
|
|
|
5
5
|
- Capture what the current project already guarantees before rewriting the requirement.
|
|
6
6
|
- Separate product intent, existing project facts, and assumptions.
|
|
7
7
|
- Prefer current repo docs, release notes, and existing behavior over memory.
|
|
8
8
|
- Record conflicts when product demand does not match current project facts.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 绂佸尯
|
|
11
11
|
|
|
12
12
|
- Do not turn implementation details into product requirements.
|
|
13
13
|
- Do not ignore existing project facts when they are available.
|
|
14
14
|
- Do not hide conflicts behind vague wording.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## 妫€鏌?
|
|
17
17
|
|
|
18
18
|
- Are product intent and project facts separated?
|
|
19
19
|
- Are conflicts and open questions explicit?
|
|
20
|
-
- Does the output still work for spec
|
|
20
|
+
- Does the output still work for spec-refinement?
|
|
21
21
|
- Is the project context based on current evidence?
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## 鍥炴斁淇″彿
|
|
24
24
|
|
|
25
25
|
- Trigger when the task needs product understanding aligned with the current project state.
|
|
26
26
|
|
|
27
27
|
## References
|
|
28
28
|
|
|
29
29
|
- `product/index.md`
|
|
30
|
+
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"bundle": "workflow",
|
|
4
4
|
"profile": "router"
|
|
5
5
|
},
|
|
6
|
-
"spec": {
|
|
6
|
+
"spec-refinement": {
|
|
7
7
|
"bundle": "workflow",
|
|
8
8
|
"profile": "refinement"
|
|
9
9
|
},
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"bundle": "product",
|
|
28
28
|
"profile": "modeling"
|
|
29
29
|
},
|
|
30
|
-
"
|
|
30
|
+
"business-fact-extraction": {
|
|
31
31
|
"bundle": "product",
|
|
32
32
|
"profile": "modeling"
|
|
33
33
|
},
|
|
34
|
-
"api-docs": {
|
|
34
|
+
"api-contract-docs": {
|
|
35
35
|
"bundle": "docs",
|
|
36
36
|
"profile": "api"
|
|
37
37
|
},
|
|
38
|
-
"security-
|
|
38
|
+
"security-audit": {
|
|
39
39
|
"bundle": "review",
|
|
40
40
|
"profile": "security"
|
|
41
41
|
},
|
|
42
|
-
"performance-
|
|
42
|
+
"performance-audit": {
|
|
43
43
|
"bundle": "review",
|
|
44
44
|
"profile": "performance"
|
|
45
45
|
},
|
|
@@ -56,3 +56,4 @@
|
|
|
56
56
|
"profile": "scaffold"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
+
|
|
@@ -7,16 +7,16 @@ This file explains which canonical skill loads which rules bundle and profile.
|
|
|
7
7
|
| Skill | Bundle | Profile |
|
|
8
8
|
|---|---|---|
|
|
9
9
|
| `workflow-router` | `workflow` | `router` |
|
|
10
|
-
| `spec` | `workflow` | `refinement` |
|
|
10
|
+
| `spec-refinement` | `workflow` | `refinement` |
|
|
11
11
|
| `technical-design` | `coding` | `analysis` |
|
|
12
12
|
| `feature-build` | `coding` | `implementation` |
|
|
13
13
|
| `test-design` | `coding` | `testing` |
|
|
14
14
|
| `code-review` | `review` | `code` |
|
|
15
15
|
| `domain-modeling` | `product` | `modeling` |
|
|
16
|
-
| `
|
|
17
|
-
| `api-docs` | `docs` | `api` |
|
|
18
|
-
| `security-
|
|
19
|
-
| `performance-
|
|
16
|
+
| `business-fact-extraction` | `product` | `modeling` |
|
|
17
|
+
| `api-contract-docs` | `docs` | `api` |
|
|
18
|
+
| `security-audit` | `review` | `security` |
|
|
19
|
+
| `performance-audit` | `review` | `performance` |
|
|
20
20
|
| `knowledge-capture` | `docs` | `capture` |
|
|
21
21
|
| `project-bootstrap` | `coding` | `scaffold` |
|
|
22
22
|
| `environment-deploy` | `coding` | `scaffold` |
|
|
@@ -26,3 +26,4 @@ This file explains which canonical skill loads which rules bundle and profile.
|
|
|
26
26
|
- `rule_profile` in skill frontmatter is the source of truth.
|
|
27
27
|
- `skill-profile-map.json` is kept as a validation and routing fallback.
|
|
28
28
|
- `code-review` intentionally uses the generic `code` profile in this repository. Stack-specific review behavior is added by overlays.
|
|
29
|
+
|
package/scripts/ci-validator.sh
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# ci-validator.sh - Skills CI
|
|
3
|
-
#
|
|
2
|
+
# ci-validator.sh - Skills CI 楠岃瘉鑴氭湰
|
|
3
|
+
# 鐢ㄤ簬楠岃瘉鎶€鑳芥枃浠剁殑瀹屾暣鎬у拰瑙勮寖鎬?
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
7
7
|
echo "=== Skills CI Validator ==="
|
|
8
8
|
|
|
9
|
-
# 1.
|
|
9
|
+
# 1. 妫€鏌ユ妧鑳芥枃浠跺畬鏁存€?
|
|
10
10
|
echo "[1/5] Checking skill files..."
|
|
11
11
|
SKILLS_DIR="${SKILLS_DIR:-.trae/skills}"
|
|
12
12
|
ERROR_COUNT=0
|
|
@@ -14,7 +14,7 @@ ERROR_COUNT=0
|
|
|
14
14
|
for skill in $(find "$SKILLS_DIR" -name "SKILL.md" -type f); do
|
|
15
15
|
skill_name=$(basename $(dirname "$skill"))
|
|
16
16
|
|
|
17
|
-
#
|
|
17
|
+
# 妫€鏌?frontmatter
|
|
18
18
|
if ! grep -q "^name:" "$skill"; then
|
|
19
19
|
echo "ERROR: Missing 'name' in $skill"
|
|
20
20
|
ERROR_COUNT=$((ERROR_COUNT + 1))
|
|
@@ -30,7 +30,7 @@ for skill in $(find "$SKILLS_DIR" -name "SKILL.md" -type f); do
|
|
|
30
30
|
echo "WARN: Missing 'version' in $skill"
|
|
31
31
|
fi
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# 妫€鏌ュ繀瑕佺珷鑺?
|
|
34
34
|
for section in "When to Run" "Workflow"; do
|
|
35
35
|
if ! grep -q "## $section" "$skill"; then
|
|
36
36
|
echo "ERROR: Missing '$section' section in $skill"
|
|
@@ -38,21 +38,21 @@ for skill in $(find "$SKILLS_DIR" -name "SKILL.md" -type f); do
|
|
|
38
38
|
fi
|
|
39
39
|
done
|
|
40
40
|
|
|
41
|
-
#
|
|
41
|
+
# 妫€鏌?Lifecycle Position锛堟柊澧烇級
|
|
42
42
|
if ! grep -q "## Lifecycle Position" "$skill"; then
|
|
43
43
|
echo "WARN: Missing 'Lifecycle Position' in $skill (recommended)"
|
|
44
44
|
fi
|
|
45
45
|
|
|
46
|
-
echo "
|
|
46
|
+
echo "鉁?$skill_name valid"
|
|
47
47
|
done
|
|
48
48
|
|
|
49
49
|
if [ "$ERROR_COUNT" -gt 0 ]; then
|
|
50
50
|
echo "ERROR: $ERROR_COUNT errors found in skill files"
|
|
51
51
|
exit 1
|
|
52
52
|
fi
|
|
53
|
-
echo "
|
|
53
|
+
echo "鉁?Skill files valid"
|
|
54
54
|
|
|
55
|
-
# 2.
|
|
55
|
+
# 2. 妫€鏌ョ敓鍛藉懆鏈熸槧灏勫畬鏁存€?
|
|
56
56
|
echo "[2/5] Checking lifecycle mapping..."
|
|
57
57
|
LIFECYCLE_STAGES="define plan build verify review ship meta"
|
|
58
58
|
for stage in $LIFECYCLE_STAGES; do
|
|
@@ -60,11 +60,11 @@ for stage in $LIFECYCLE_STAGES; do
|
|
|
60
60
|
if [ "$count" -eq 0 ] && [ "$stage" != "meta" ]; then
|
|
61
61
|
echo "WARN: No skill mapped to '$stage' stage"
|
|
62
62
|
else
|
|
63
|
-
echo "
|
|
63
|
+
echo "鉁?$stage stage has $count skills"
|
|
64
64
|
fi
|
|
65
65
|
done
|
|
66
66
|
|
|
67
|
-
# 3.
|
|
67
|
+
# 3. 妫€鏌ユ妧鑳介棿渚濊禆涓€鑷存€?
|
|
68
68
|
echo "[3/5] Checking skill dependencies..."
|
|
69
69
|
for skill in $(find "$SKILLS_DIR" -name "SKILL.md" -type f); do
|
|
70
70
|
deps=$(grep "^dependencies:" "$skill" | sed 's/dependencies: //' | tr ',' ' ' 2>/dev/null || echo "")
|
|
@@ -81,34 +81,34 @@ if [ "$ERROR_COUNT" -gt 0 ]; then
|
|
|
81
81
|
echo "ERROR: Dependency errors found"
|
|
82
82
|
exit 1
|
|
83
83
|
fi
|
|
84
|
-
echo "
|
|
84
|
+
echo "鉁?Dependencies valid"
|
|
85
85
|
|
|
86
|
-
# 4.
|
|
86
|
+
# 4. 妫€鏌?Reference Checklists
|
|
87
87
|
echo "[4/5] Checking reference checklists..."
|
|
88
|
-
REQUIRED_CHECKLISTS="coding-checklist.md solid-checklist.md security-checklist.md performance-
|
|
88
|
+
REQUIRED_CHECKLISTS="coding-checklist.md solid-checklist.md security-checklist.md performance-auditlist.md anti-rationalization.md"
|
|
89
89
|
for checklist in $REQUIRED_CHECKLISTS; do
|
|
90
90
|
found=$(find "$SKILLS_DIR" -name "$checklist" -type f | wc -l)
|
|
91
91
|
if [ "$found" -eq 0 ]; then
|
|
92
92
|
echo "WARN: Missing reference checklist '$checklist'"
|
|
93
93
|
else
|
|
94
|
-
echo "
|
|
94
|
+
echo "鉁?Found $checklist"
|
|
95
95
|
fi
|
|
96
96
|
done
|
|
97
97
|
|
|
98
|
-
# 5.
|
|
98
|
+
# 5. 妫€鏌?Agent Personas 鍜?Slash Commands
|
|
99
99
|
echo "[5/5] Checking agent personas and slash commands..."
|
|
100
100
|
if [ ! -f "$SKILLS_DIR/../references/agent-personas.md" ]; then
|
|
101
101
|
echo "WARN: Missing agent-personas.md"
|
|
102
102
|
else
|
|
103
|
-
echo "
|
|
103
|
+
echo "鉁?Found agent-personas.md"
|
|
104
104
|
fi
|
|
105
105
|
|
|
106
106
|
if [ ! -f "$SKILLS_DIR/../references/slash-commands.md" ]; then
|
|
107
107
|
echo "WARN: Missing slash-commands.md"
|
|
108
108
|
else
|
|
109
|
-
echo "
|
|
109
|
+
echo "鉁?Found slash-commands.md"
|
|
110
110
|
fi
|
|
111
111
|
|
|
112
112
|
echo "=== CI Validator Complete ==="
|
|
113
113
|
echo "All checks passed!"
|
|
114
|
-
exit 0
|
|
114
|
+
exit 0
|
|
@@ -6,13 +6,13 @@ const path = require('path');
|
|
|
6
6
|
const repoRoot = path.join(__dirname, '..');
|
|
7
7
|
const skillsRoot = path.join(repoRoot, 'skills');
|
|
8
8
|
const enhancedTemplateSkills = new Set([
|
|
9
|
-
'spec',
|
|
9
|
+
'spec-refinement',
|
|
10
10
|
'technical-design',
|
|
11
11
|
'feature-build',
|
|
12
12
|
'code-review',
|
|
13
|
-
'security-
|
|
14
|
-
'performance-
|
|
15
|
-
'
|
|
13
|
+
'security-audit',
|
|
14
|
+
'performance-audit',
|
|
15
|
+
'business-fact-extraction',
|
|
16
16
|
]);
|
|
17
17
|
const enhancedSections = [
|
|
18
18
|
'## Quick Start',
|
|
@@ -140,3 +140,4 @@ try {
|
|
|
140
140
|
console.error(error.message);
|
|
141
141
|
process.exitCode = 1;
|
|
142
142
|
}
|
|
143
|
+
|
|
@@ -6,12 +6,12 @@ $ErrorActionPreference = 'Stop'
|
|
|
6
6
|
$repoRoot = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '..')).Path
|
|
7
7
|
$python = Join-Path $repoRoot '.tools\python.cmd'
|
|
8
8
|
if (-not $SkillsRoot) {
|
|
9
|
-
if (Test-Path -LiteralPath (Join-Path $repoRoot 'skills')) {
|
|
10
|
-
$SkillsRoot = Join-Path $repoRoot 'skills'
|
|
11
|
-
} else {
|
|
12
|
-
$SkillsRoot = Join-Path $repoRoot '.
|
|
13
|
-
}
|
|
14
|
-
}
|
|
9
|
+
if (Test-Path -LiteralPath (Join-Path $repoRoot 'skills')) {
|
|
10
|
+
$SkillsRoot = Join-Path $repoRoot 'skills'
|
|
11
|
+
} else {
|
|
12
|
+
$SkillsRoot = Join-Path $repoRoot '.codex\skills\pigcloud'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
15
|
$codexHome = $env:CODEX_HOME
|
|
16
16
|
if (-not $codexHome) {
|
|
17
17
|
$codexHome = Join-Path $HOME '.codex'
|
|
@@ -7,11 +7,11 @@ codex_home="${CODEX_HOME:-$HOME/.codex}"
|
|
|
7
7
|
validator="$codex_home/skills/.system/skill-creator/scripts/quick_validate.py"
|
|
8
8
|
if [ -n "${1:-}" ]; then
|
|
9
9
|
skills_root="$1"
|
|
10
|
-
elif [ -d "$repo_root/skills" ]; then
|
|
11
|
-
skills_root="$repo_root/skills"
|
|
12
|
-
else
|
|
13
|
-
skills_root="$repo_root/.
|
|
14
|
-
fi
|
|
10
|
+
elif [ -d "$repo_root/skills" ]; then
|
|
11
|
+
skills_root="$repo_root/skills"
|
|
12
|
+
else
|
|
13
|
+
skills_root="$repo_root/.codex/skills/pigcloud"
|
|
14
|
+
fi
|
|
15
15
|
|
|
16
16
|
if [ ! -f "$validator" ]; then
|
|
17
17
|
echo "Validator not found: $validator" >&2
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: api-docs
|
|
3
|
-
description: 当接口需要可复用参考文档时,记录稳定的 API
|
|
2
|
+
name: api-contract-docs
|
|
3
|
+
description: 当接口需要可复用参考文档时,记录稳定的 API 行为、请求、响应契约和示例
|
|
4
4
|
lifecycle_stage: capture
|
|
5
5
|
rule_profile: api
|
|
6
6
|
dependencies:
|
|
7
|
-
- spec
|
|
7
|
+
- spec-refinement
|
|
8
8
|
triggers:
|
|
9
9
|
- API docs
|
|
10
10
|
- contract
|
|
@@ -36,7 +36,7 @@ refs:
|
|
|
36
36
|
- rules/index.md
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
-
# API Docs
|
|
39
|
+
# API Contract Docs
|
|
40
40
|
|
|
41
41
|
## Purpose
|
|
42
42
|
|
|
@@ -74,3 +74,4 @@ Write clear API documentation and contracts for already defined behavior.
|
|
|
74
74
|
- `skills/references/prompt-replay-checklist.md`
|
|
75
75
|
- `skills/references/full-chain-replay-scenarios.md`
|
|
76
76
|
- `rules/index.md`
|
|
77
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: business-fact-extraction
|
|
3
|
+
description: 当 Codex 需要逆向理解系统真实行为或为领域建模、需求细化或知识沉淀准备证据时,从代码、测试、日志和文档中提取业务事实、当前行为、不变量和术语
|
|
4
4
|
lifecycle_stage: analysis
|
|
5
5
|
rule_profile: modeling
|
|
6
6
|
dependencies: []
|
|
@@ -30,7 +30,7 @@ workflow:
|
|
|
30
30
|
- mark each fact as evidence-backed, inferred, or unknown
|
|
31
31
|
- summarize gaps, contradictions, and open questions
|
|
32
32
|
- choose the destination knowledge-base files before writing the final note
|
|
33
|
-
- hand off to domain-modeling, spec, or knowledge-capture
|
|
33
|
+
- hand off to domain-modeling, spec-refinement, or knowledge-capture
|
|
34
34
|
gates:
|
|
35
35
|
- stop at fact extraction
|
|
36
36
|
- do not design a new solution
|
|
@@ -43,7 +43,7 @@ refs:
|
|
|
43
43
|
- docs/codewiki-knowledge-base.md
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
#
|
|
46
|
+
# Business Fact Extraction
|
|
47
47
|
|
|
48
48
|
## Purpose
|
|
49
49
|
|
|
@@ -59,12 +59,12 @@ Turn code-backed evidence into reusable business facts.
|
|
|
59
59
|
- Start from code paths, tests, docs, runtime traces, and schemas.
|
|
60
60
|
- Produce the output in three stages: code facts, business facts, and CodeWiki updates.
|
|
61
61
|
- Keep evidence, inference, and unknowns distinct.
|
|
62
|
-
- Hand off the result when the facts are stable enough for `domain-modeling`, `spec`, or `knowledge-capture`.
|
|
62
|
+
- Hand off the result when the facts are stable enough for `domain-modeling`, `spec-refinement`, or `knowledge-capture`.
|
|
63
63
|
|
|
64
64
|
## Write Back
|
|
65
65
|
|
|
66
66
|
- When the user wants persistence, render the staged output into a JSON fact pack.
|
|
67
|
-
- Use `skills/
|
|
67
|
+
- Use `skills/business-fact-extraction/scripts/write-knowledge-base.js` to write the pack into the knowledge-base files.
|
|
68
68
|
- Keep the pack keyed by target file path under `knowledge-base/`.
|
|
69
69
|
- Write only the smallest matching file for each fact.
|
|
70
70
|
- Treat the script as a writer, not as a second analysis pass.
|
|
@@ -251,7 +251,7 @@ Turn code-backed evidence into reusable business facts.
|
|
|
251
251
|
- decision: inventory must be reserved before order confirmation
|
|
252
252
|
- reason: avoid overselling
|
|
253
253
|
- date or context: 2026-06-22, order flow review
|
|
254
|
-
- affected artifact: checkout spec
|
|
254
|
+
- affected artifact: checkout spec-refinement
|
|
255
255
|
- notes: failure should return a clear stock shortage message
|
|
256
256
|
|
|
257
257
|
#### `knowledge-base/requirements/acceptance.md`
|
|
@@ -303,7 +303,7 @@ Turn code-backed evidence into reusable business facts.
|
|
|
303
303
|
5. Map each section to the exact knowledge-base files it should update.
|
|
304
304
|
6. Mark each fact as evidence-backed, inferred, or unknown.
|
|
305
305
|
7. Summarize gaps, contradictions, and open questions.
|
|
306
|
-
8. Hand off to `domain-modeling`, `spec`, or `knowledge-capture`.
|
|
306
|
+
8. Hand off to `domain-modeling`, `spec-refinement`, or `knowledge-capture`.
|
|
307
307
|
|
|
308
308
|
## Replay Signals
|
|
309
309
|
|
|
@@ -334,3 +334,4 @@ Turn code-backed evidence into reusable business facts.
|
|
|
334
334
|
- `skills/references/skill-reference-matrix.md`
|
|
335
335
|
- `skills/references/rule-loading-map.md`
|
|
336
336
|
- `docs/codewiki-knowledge-base.md`
|
|
337
|
+
|
package/skills/{extract-business-facts → business-fact-extraction}/scripts/write-knowledge-base.js
RENAMED
|
@@ -4,8 +4,8 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
|
|
6
6
|
const REPO_ROOT = path.join(__dirname, '..', '..', '..');
|
|
7
|
-
const START_MARKER = '<!--
|
|
8
|
-
const END_MARKER = '<!--
|
|
7
|
+
const START_MARKER = '<!-- business-fact-extraction:start -->';
|
|
8
|
+
const END_MARKER = '<!-- business-fact-extraction:end -->';
|
|
9
9
|
|
|
10
10
|
const FILE_FIELD_ORDER = {
|
|
11
11
|
'knowledge-base/realtime-code/modules.md': ['module', 'current responsibility', 'key entry points', 'important constraints', 'last verified'],
|
|
@@ -43,7 +43,7 @@ const SAMPLE_PACK = {
|
|
|
43
43
|
decision: 'inventory must be reserved before order confirmation',
|
|
44
44
|
reason: 'avoid overselling',
|
|
45
45
|
'date or context': '2026-06-22, order flow review',
|
|
46
|
-
'affected artifact': 'checkout spec',
|
|
46
|
+
'affected artifact': 'checkout spec-refinement',
|
|
47
47
|
notes: 'failure should return a clear stock shortage message'
|
|
48
48
|
}
|
|
49
49
|
],
|
|
@@ -225,3 +225,4 @@ try {
|
|
|
225
225
|
console.error(error.message);
|
|
226
226
|
process.exitCode = 1;
|
|
227
227
|
}
|
|
228
|
+
|
|
@@ -26,8 +26,8 @@ workflow:
|
|
|
26
26
|
- lock the review scope
|
|
27
27
|
- identify the tech stack and load the matching review overlay(s)
|
|
28
28
|
- inspect correctness, maintainability, and regression risk
|
|
29
|
-
- route security-specific issues to `security-
|
|
30
|
-
- route performance-specific issues to `performance-
|
|
29
|
+
- route security-specific issues to `security-audit`
|
|
30
|
+
- route performance-specific issues to `performance-audit`
|
|
31
31
|
- rank findings by severity
|
|
32
32
|
- produce an actionable review report
|
|
33
33
|
gates:
|
|
@@ -63,8 +63,8 @@ Review a change set and return actionable findings.
|
|
|
63
63
|
- Identify the stack(s) first. This repository may apply Java, Vue, or mixed-stack review overlays.
|
|
64
64
|
- Read the diff with the current rules bundle in mind.
|
|
65
65
|
- Report findings with severity and a concrete fix path.
|
|
66
|
-
- If the issue is clearly about auth, secrets, or exposure, hand off to `security-
|
|
67
|
-
- If the issue is clearly about latency, throughput, or resource usage, hand off to `performance-
|
|
66
|
+
- If the issue is clearly about auth, secrets, or exposure, hand off to `security-audit`.
|
|
67
|
+
- If the issue is clearly about latency, throughput, or resource usage, hand off to `performance-audit`.
|
|
68
68
|
- Keep stack-specific concerns in the matching overlay and keep the core review generic.
|
|
69
69
|
|
|
70
70
|
## Report Format
|
|
@@ -96,8 +96,8 @@ Review a change set and return actionable findings.
|
|
|
96
96
|
1. Lock the review scope.
|
|
97
97
|
2. Identify the stack overlays and load the matching review baseline(s) when applicable.
|
|
98
98
|
3. Inspect correctness, maintainability, and regression risk.
|
|
99
|
-
4. Route security-specific issues to `security-
|
|
100
|
-
5. Route performance-specific issues to `performance-
|
|
99
|
+
4. Route security-specific issues to `security-audit`.
|
|
100
|
+
5. Route performance-specific issues to `performance-audit`.
|
|
101
101
|
6. Rank findings by severity.
|
|
102
102
|
7. Produce an actionable review report.
|
|
103
103
|
|
|
@@ -133,3 +133,4 @@ Review a change set and return actionable findings.
|
|
|
133
133
|
- `rules/review/code.md`
|
|
134
134
|
- `rules/review/java.md`
|
|
135
135
|
- `rules/review/vue.md`
|
|
136
|
+
|
|
@@ -23,7 +23,7 @@ workflow:
|
|
|
23
23
|
- extract the core domain terms
|
|
24
24
|
- group concepts by boundary
|
|
25
25
|
- identify aggregates and dependencies
|
|
26
|
-
- hand off to technical-design or spec
|
|
26
|
+
- hand off to technical-design or spec-refinement
|
|
27
27
|
gates:
|
|
28
28
|
- stop at domain boundaries
|
|
29
29
|
- do not implement code
|
|
@@ -51,14 +51,14 @@ Extract domain boundaries and core concepts from messy input.
|
|
|
51
51
|
1. Extract the core domain terms.
|
|
52
52
|
2. Group concepts by boundary.
|
|
53
53
|
3. Identify aggregates and dependencies.
|
|
54
|
-
4. Hand off to `technical-design` or `spec`.
|
|
54
|
+
4. Hand off to `technical-design` or `spec-refinement`.
|
|
55
55
|
|
|
56
56
|
## Replay Signals
|
|
57
57
|
|
|
58
58
|
- Input signal: existing business language, product context, code, or documents.
|
|
59
59
|
- Output to verify: domain map, core concepts, boundary notes.
|
|
60
60
|
- Stop signal: implementation code or PRD drafting.
|
|
61
|
-
- Handoff signal: the boundary map is ready for `technical-design` or `spec`.
|
|
61
|
+
- Handoff signal: the boundary map is ready for `technical-design` or `spec-refinement`.
|
|
62
62
|
|
|
63
63
|
## Examples
|
|
64
64
|
|
|
@@ -78,3 +78,4 @@ Extract domain boundaries and core concepts from messy input.
|
|
|
78
78
|
- `skills/references/rule-loading-map.md`
|
|
79
79
|
- `skills/references/prompt-replay-checklist.md`
|
|
80
80
|
- `skills/references/full-chain-replay-scenarios.md`
|
|
81
|
+
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feature-build
|
|
3
|
-
description: 在代码、重构或集成工作需要保持在既定边界内时,实现已批准的设计变更
|
|
4
|
-
lifecycle_stage: build
|
|
3
|
+
description: 在代码、重构或集成工作需要保持在既定边界内时,实现已批准的设计变更
|
|
5
4
|
rule_profile: implementation
|
|
6
5
|
dependencies:
|
|
7
6
|
- technical-design
|
|
@@ -14,7 +13,7 @@ triggers:
|
|
|
14
13
|
- service
|
|
15
14
|
- mapper
|
|
16
15
|
inputs:
|
|
17
|
-
- executable spec
|
|
16
|
+
- executable spec-refinement
|
|
18
17
|
- design decisions
|
|
19
18
|
- confirmed task breakdown plan
|
|
20
19
|
- rules bundle
|
|
@@ -33,7 +32,7 @@ workflow:
|
|
|
33
32
|
- hand off to test-design
|
|
34
33
|
gates:
|
|
35
34
|
- stop at implementation
|
|
36
|
-
- do not rewrite the spec
|
|
35
|
+
- do not rewrite the spec-refinement
|
|
37
36
|
- do not change the agreed boundaries
|
|
38
37
|
- do not bypass the rules bundle
|
|
39
38
|
refs:
|
|
@@ -59,7 +58,7 @@ Implement the approved design without changing the agreed scope.
|
|
|
59
58
|
|
|
60
59
|
- Load the selected rules bundle first.
|
|
61
60
|
- Implement only the confirmed scope from the approved design.
|
|
62
|
-
- Split work into small tasks before implementation if the spec is still too coarse.
|
|
61
|
+
- Split work into small tasks before implementation if the spec-refinement is still too coarse.
|
|
63
62
|
- Treat the task as the smallest implementation unit.
|
|
64
63
|
- Validate each task locally before starting the next one.
|
|
65
64
|
- Record evidence immediately after each task is complete.
|
|
@@ -68,7 +67,7 @@ Implement the approved design without changing the agreed scope.
|
|
|
68
67
|
## Inputs / Outputs
|
|
69
68
|
|
|
70
69
|
- Inputs:
|
|
71
|
-
- executable spec
|
|
70
|
+
- executable spec-refinement
|
|
72
71
|
- design decisions
|
|
73
72
|
- confirmed task breakdown plan
|
|
74
73
|
- rules bundle
|
|
@@ -90,14 +89,14 @@ Implement the approved design without changing the agreed scope.
|
|
|
90
89
|
|
|
91
90
|
## Replay Signals
|
|
92
91
|
|
|
93
|
-
- Input signal: confirmed spec, approved design, confirmed task breakdown plan, and selected rules bundle.
|
|
92
|
+
- Input signal: confirmed spec-refinement, approved design, confirmed task breakdown plan, and selected rules bundle.
|
|
94
93
|
- Output to verify: code changes, implementation notes, validation evidence, self-test evidence, task-level evidence.
|
|
95
|
-
- Stop signal: spec rewrites, scope expansion, or bypassing the rules bundle.
|
|
94
|
+
- Stop signal: spec-refinement rewrites, scope expansion, or bypassing the rules bundle.
|
|
96
95
|
- Handoff signal: implementation is ready for `test-design`.
|
|
97
96
|
|
|
98
97
|
## Gotchas
|
|
99
98
|
|
|
100
|
-
- Do not rewrite the spec while implementing.
|
|
99
|
+
- Do not rewrite the spec-refinement while implementing.
|
|
101
100
|
- Do not expand the boundary because implementation is inconvenient.
|
|
102
101
|
- Do not bypass the rules bundle for convenience.
|
|
103
102
|
- Do not leave validation evidence implicit.
|
|
@@ -108,7 +107,7 @@ Implement the approved design without changing the agreed scope.
|
|
|
108
107
|
## Stop Rules
|
|
109
108
|
|
|
110
109
|
- Stop at implementation.
|
|
111
|
-
- Do not rewrite the spec.
|
|
110
|
+
- Do not rewrite the spec-refinement.
|
|
112
111
|
- Do not change the agreed boundaries.
|
|
113
112
|
- Do not skip the rules bundle.
|
|
114
113
|
- Do not bypass the rules bundle.
|
|
@@ -120,3 +119,4 @@ Implement the approved design without changing the agreed scope.
|
|
|
120
119
|
- `skills/references/engineering-delivery-method.md`
|
|
121
120
|
- `skills/references/engineering-delivery-template.md`
|
|
122
121
|
- `rules/index.md`
|
|
122
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: knowledge-capture
|
|
3
|
-
description:
|
|
3
|
+
description: 当上游任务已经产出证据,需要整理、沉淀或交接而不想重做分析时,提炼可复用的决策、需求知识、实时代码事实、CodeWiki 事实和交接笔记
|
|
4
4
|
lifecycle_stage: capture
|
|
5
5
|
rule_profile: capture
|
|
6
6
|
dependencies: []
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: performance-
|
|
3
|
-
description: 当需要性能结论时,对变更中的延迟、吞吐量或资源瓶颈进行审查
|
|
4
|
-
lifecycle_stage: review
|
|
2
|
+
name: performance-audit
|
|
3
|
+
description: 当需要性能结论时,对变更中的延迟、吞吐量或资源瓶颈进行审查
|
|
5
4
|
rule_profile: performance
|
|
6
5
|
dependencies:
|
|
7
6
|
- feature-build
|
|
@@ -40,7 +39,7 @@ refs:
|
|
|
40
39
|
- rules/index.md
|
|
41
40
|
---
|
|
42
41
|
|
|
43
|
-
# Performance
|
|
42
|
+
# Performance Audit
|
|
44
43
|
|
|
45
44
|
## Purpose
|
|
46
45
|
|
|
@@ -115,3 +114,5 @@ Find performance bottlenecks and optimization opportunities.
|
|
|
115
114
|
- `skills/references/prompt-replay-checklist.md`
|
|
116
115
|
- `skills/references/full-chain-replay-scenarios.md`
|
|
117
116
|
- `rules/index.md`
|
|
117
|
+
|
|
118
|
+
# Performance Audit
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: project-bootstrap
|
|
3
|
-
description: 当项目需要初始化时,为新工作区装载合适的技能和规则包
|
|
3
|
+
description: 当项目需要初始化时,为新工作区装载合适的技能和规则包
|
|
4
4
|
lifecycle_stage: scaffold
|
|
5
5
|
rule_profile: scaffold
|
|
6
6
|
dependencies: []
|
|
@@ -58,7 +58,7 @@ Create a new workspace with the right skills and rules layout.
|
|
|
58
58
|
- Input signal: client type, workspace markers, desired rules bundle.
|
|
59
59
|
- Output to verify: starter structure, installed bundle, setup notes.
|
|
60
60
|
- Stop signal: product scope design or application code generation.
|
|
61
|
-
- Handoff signal: the workspace is ready for `workflow-router` or `spec`.
|
|
61
|
+
- Handoff signal: the workspace is ready for `workflow-router` or `spec-refinement`.
|
|
62
62
|
|
|
63
63
|
## Examples
|
|
64
64
|
|
|
@@ -78,3 +78,4 @@ Create a new workspace with the right skills and rules layout.
|
|
|
78
78
|
- `skills/references/prompt-replay-checklist.md`
|
|
79
79
|
- `skills/references/full-chain-replay-scenarios.md`
|
|
80
80
|
- `rules/index.md`
|
|
81
|
+
|