@ai-content-space/loopx 0.2.8 → 0.2.9

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.
Files changed (43) hide show
  1. package/README.md +16 -3
  2. package/README.zh-CN.md +16 -3
  3. package/docs/loopx/plans/2026-06-14-loopx-spec-memory-context-loading.md +948 -0
  4. package/package.json +1 -1
  5. package/plugins/loopx/.codex-plugin/plugin.json +1 -1
  6. package/plugins/loopx/skills/clarify/SKILL.md +12 -1
  7. package/plugins/loopx/skills/debug/SKILL.md +1 -1
  8. package/plugins/loopx/skills/doc-readability/SKILL.md +1 -1
  9. package/plugins/loopx/skills/exec/SKILL.md +1 -1
  10. package/plugins/loopx/skills/final-review/SKILL.md +1 -1
  11. package/plugins/loopx/skills/finish/SKILL.md +1 -1
  12. package/plugins/loopx/skills/fix-review/SKILL.md +1 -1
  13. package/plugins/loopx/skills/go-style/SKILL.md +1 -1
  14. package/plugins/loopx/skills/kratos/SKILL.md +1 -1
  15. package/plugins/loopx/skills/plan-to-exec/SKILL.md +12 -1
  16. package/plugins/loopx/skills/refactor-plan/SKILL.md +1 -1
  17. package/plugins/loopx/skills/review/SKILL.md +1 -1
  18. package/plugins/loopx/skills/spec/SKILL.md +12 -1
  19. package/plugins/loopx/skills/subagent-exec/SKILL.md +1 -1
  20. package/plugins/loopx/skills/tdd/SKILL.md +1 -1
  21. package/plugins/loopx/skills/verify/SKILL.md +1 -1
  22. package/skills/clarify/SKILL.md +12 -1
  23. package/skills/debug/SKILL.md +1 -1
  24. package/skills/doc-readability/SKILL.md +1 -1
  25. package/skills/exec/SKILL.md +1 -1
  26. package/skills/final-review/SKILL.md +1 -1
  27. package/skills/finish/SKILL.md +1 -1
  28. package/skills/fix-review/SKILL.md +1 -1
  29. package/skills/go-style/SKILL.md +1 -1
  30. package/skills/kratos/SKILL.md +1 -1
  31. package/skills/plan-to-exec/SKILL.md +12 -1
  32. package/skills/refactor-plan/SKILL.md +1 -1
  33. package/skills/review/SKILL.md +1 -1
  34. package/skills/spec/SKILL.md +12 -1
  35. package/skills/subagent-exec/SKILL.md +1 -1
  36. package/skills/tdd/SKILL.md +1 -1
  37. package/skills/verify/SKILL.md +1 -1
  38. package/src/cli.mjs +4 -1
  39. package/src/context-manifest.mjs +51 -1
  40. package/src/install-discovery.mjs +109 -0
  41. package/src/loopx-context-artifacts.mjs +114 -0
  42. package/src/project-discovery.mjs +1 -0
  43. package/src/workflow.mjs +47 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-content-space/loopx",
3
3
  "type": "module",
4
- "version": "0.2.8",
4
+ "version": "0.2.9",
5
5
  "description": "Skill-first workflow suite for agentic coding assistants",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopx",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Skill-first workflow suite for agentic coding assistants",
5
5
  "skills": "./skills/",
6
6
  "interface": {
@@ -3,7 +3,7 @@ name: clarify
3
3
  description: "Grills ambiguous loopx work until material questions are answered, then routes to spec or plan using a design gate. Not for clear implementation tasks, approved specs, or code changes."
4
4
  when_to_use: "clarify, requirements, ambiguous request, unclear scope, non-goals, decision boundaries, acceptance criteria, 需求澄清, 范围不清"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # loopx Clarify
@@ -12,6 +12,17 @@ Do not accept vague answers. Do not optimize for speed. The goal is shared under
12
12
 
13
13
  ## Core Loop
14
14
 
15
+ ## Repo Specs And Memory Context
16
+
17
+ Before using this skill in a repository, inspect loopx long-lived context when it exists:
18
+
19
+ - If `docs/loopx/specs/` exists, inspect the directory names and filenames. If `docs/loopx/specs/index.md` exists, use it as a map, but do not require it. Read only specs relevant to the requested domain, affected files, workflow behavior, or named source document.
20
+ - If `.loopx/memory/MEMORY.md` exists, read it as curated project memory before deciding what is already known.
21
+ - If `.loopx/memory/index.jsonl` exists, use it only as a retrieval index for relevant active memory cards; do not treat it as an append-only log.
22
+ - Treat current user instructions and the named source document as highest priority, `docs/loopx/specs/` as binding long-lived repo rules, and `.loopx/memory/` as advisory context. Memory is advisory and must not override current task instructions, approved source docs, or repo specs.
23
+
24
+ Do not read every file under `docs/loopx/specs/` by default. Prefer relevant specs selected by filename, title, frontmatter such as `applies_to`, or the files/domains involved in the task.
25
+
15
26
  Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
16
27
 
17
28
  Ask the questions one at a time.
@@ -3,7 +3,7 @@ name: debug
3
3
  description: "Finds root cause for bugs, failing tests, build failures, regressions, and unexpected behavior before fixes. Not for new feature planning or routine code review."
4
4
  when_to_use: "debug, bug, test failure, build failure, regression, unexpected behavior, root cause, 报错, 失败, 回归, 排查"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Systematic Debugging
@@ -3,7 +3,7 @@ name: doc-readability
3
3
  description: "Use when evaluating, rewriting, or editing documents for human readability, unclear viewpoints, AI-like prose, bloated specs, PRDs, requirements docs, meeting notes, strategy docs, or internal knowledge-base articles. Not for code review, implementation planning, or file-format conversion."
4
4
  when_to_use: "document readability, PRD assessment, requirements gaps, AI-like prose, unclear viewpoint, rewrite docs, editing docs, 文档可读性, 去AI味, 需求文档评估"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Doc Readability
@@ -3,7 +3,7 @@ name: exec
3
3
  description: "Executes a written loopx implementation plan sequentially with review checkpoints. Not for unclear plans, missing requirements, or subagent-first execution."
4
4
  when_to_use: "written implementation plan, inline execution, sequential plan execution, review checkpoints, no subagent lane"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Exec
@@ -3,7 +3,7 @@ name: final-review
3
3
  description: "Performs whole-feature review after implementation and staged task review. Not for per-task review, unresolved scope, implementation, or pure documentation polish."
4
4
  when_to_use: "final-review, final code review, whole feature review, integration review, pre-finish review, after subagent-exec, runtime risk review, 最终评审"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Final Review
@@ -3,7 +3,7 @@ name: finish
3
3
  description: "Finishes completed loopx development work after tests pass by presenting merge, PR, keep, or discard options. Not for unfinished work or failing verification."
4
4
  when_to_use: "implementation complete, tests pass, finish branch, create pull request, merge locally, keep branch, discard work"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Finish
@@ -3,7 +3,7 @@ name: fix-review
3
3
  description: "Handles received code review feedback with verification, technical evaluation, pushback, and one-item-at-a-time fixes. Not for requesting a new review or implementing unrelated changes."
4
4
  when_to_use: "fix-review, received code review feedback, review comments, reviewer suggestions, requested changes, 处理评审意见"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Fix Review
@@ -3,7 +3,7 @@ name: go-style
3
3
  description: "Applies loopx Go coding style for .go edits, tests, errors, context, naming, and interface boundaries. Not for non-Go code or Kratos-specific architecture by itself."
4
4
  when_to_use: "go-style, Go, golang, .go files, go tests, gofmt, idiomatic Go, Go style, Go 代码"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Go Style
@@ -3,7 +3,7 @@ name: kratos
3
3
  description: "Supports Go-Kratos microservices, proto/buf APIs, service/biz/data layers, middleware, auth, config, and troubleshooting. Not for generic Go style alone."
4
4
  when_to_use: "kratos, Go-Kratos, proto, buf, service layer, biz layer, data layer, middleware, auth, config, Kratos 微服务"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Kratos
@@ -3,7 +3,7 @@ name: plan-to-exec
3
3
  description: "Creates bite-sized implementation plans from approved requirements, clarify output, or design specs with exact files, tests, commands, expected output, and execution handoff. Not for unresolved requirements, design decisions, PRD generation, or code changes."
4
4
  when_to_use: "plan-to-exec, plan, implementation plan, execution plan, task breakdown, approved requirements, approved design spec, docs/loopx/design, 实施计划, 执行计划, 任务拆分"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  argument-hint: "<design spec path or feature name>"
8
8
  ---
9
9
 
@@ -21,6 +21,17 @@ Use this skill after requirements are clear. The source may be:
21
21
  - `.loopx/intake/clarify-<slug>-<timestamp>.md`
22
22
  - an issue, PRD, or requirements document that already fixes material decisions
23
23
 
24
+ ## Repo Specs And Memory Context
25
+
26
+ Before using this skill in a repository, inspect loopx long-lived context when it exists:
27
+
28
+ - If `docs/loopx/specs/` exists, inspect the directory names and filenames. If `docs/loopx/specs/index.md` exists, use it as a map, but do not require it. Read only specs relevant to the requested domain, affected files, workflow behavior, or named source document.
29
+ - If `.loopx/memory/MEMORY.md` exists, read it as curated project memory before deciding what is already known.
30
+ - If `.loopx/memory/index.jsonl` exists, use it only as a retrieval index for relevant active memory cards; do not treat it as an append-only log.
31
+ - Treat current user instructions and the named source document as highest priority, `docs/loopx/specs/` as binding long-lived repo rules, and `.loopx/memory/` as advisory context. Memory is advisory and must not override current task instructions, approved source docs, or repo specs.
32
+
33
+ Do not read every file under `docs/loopx/specs/` by default. Prefer relevant specs selected by filename, title, frontmatter such as `applies_to`, or the files/domains involved in the task.
34
+
24
35
  Do not re-decide product or architecture. If the source is incomplete, contradictory, or missing product behavior, API, data, state, permission, migration, compatibility, or architecture decisions, return to `clarify` or `spec` instead of filling those gaps inside `plan`.
25
36
 
26
37
  **Announce at start:** "I'm using the plan-to-exec skill to create the implementation plan."
@@ -3,7 +3,7 @@ name: refactor-plan
3
3
  description: "Creates a behavior-preserving refactor plan with user interview, repo evidence, tiny commits, scope boundaries, and testing decisions. Not for feature changes or immediate implementation."
4
4
  when_to_use: "refactor-plan, refactor request, refactoring RFC, tiny commits, behavior-preserving cleanup, architecture cleanup, 重构计划"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  This skill will be invoked when the user wants to create a refactor request. You should go through the steps below. You may skip steps if you don't consider them necessary.
@@ -3,7 +3,7 @@ name: review
3
3
  description: "Dispatches a loopx code reviewer subagent against a concrete git range and requirements. Not for implementation, planning, or unresolved review scope."
4
4
  when_to_use: "request code review, completed task review, major feature review, pre-merge review, subagent code quality check"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Review
@@ -3,7 +3,7 @@ name: spec
3
3
  description: "Writes software design specs from already-clarified requirements, including solution approach, architecture outline, detailed design, tradeoffs, verification design, and handoff context. Not for unresolved requirements, PRD generation, implementation task planning, or code changes."
4
4
  when_to_use: "spec, design spec, technical design, design proposal, detailed design, architecture design, 设计方案, 概要设计, 详细设计, 技术方案"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # loopx Spec
@@ -12,6 +12,17 @@ Turn clarified requirements into design documents. Do not invent missing require
12
12
 
13
13
  ## Inputs
14
14
 
15
+ ## Repo Specs And Memory Context
16
+
17
+ Before using this skill in a repository, inspect loopx long-lived context when it exists:
18
+
19
+ - If `docs/loopx/specs/` exists, inspect the directory names and filenames. If `docs/loopx/specs/index.md` exists, use it as a map, but do not require it. Read only specs relevant to the requested domain, affected files, workflow behavior, or named source document.
20
+ - If `.loopx/memory/MEMORY.md` exists, read it as curated project memory before deciding what is already known.
21
+ - If `.loopx/memory/index.jsonl` exists, use it only as a retrieval index for relevant active memory cards; do not treat it as an append-only log.
22
+ - Treat current user instructions and the named source document as highest priority, `docs/loopx/specs/` as binding long-lived repo rules, and `.loopx/memory/` as advisory context. Memory is advisory and must not override current task instructions, approved source docs, or repo specs.
23
+
24
+ Do not read every file under `docs/loopx/specs/` by default. Prefer relevant specs selected by filename, title, frontmatter such as `applies_to`, or the files/domains involved in the task.
25
+
15
26
  Use the user's PRD, external requirements document, or approved `clarify` output as the source of truth.
16
27
 
17
28
  Before writing, inspect relevant code and docs when the task touches an existing system. If a design question can be answered from the repo, answer it from evidence. If a material requirement, constraint, owner decision, or product behavior is still unclear, stop and route back to `clarify`.
@@ -3,7 +3,7 @@ name: subagent-exec
3
3
  description: "Executes approved loopx implementation plans with fresh subagents per independent task and staged review. Not for planning, unclear requirements, or tightly coupled edits."
4
4
  when_to_use: "approved implementation plan, independent tasks, subagent execution, staged spec review, code quality review, parallel-capable execution"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Subagent Exec
@@ -3,7 +3,7 @@ name: tdd
3
3
  description: "Guides feature and bugfix implementation through a failing test before production code and red-green-refactor discipline. Not for generated files or throwaway prototypes."
4
4
  when_to_use: "tdd, failing test first, feature implementation, bugfix, regression test, red green refactor, 测试先行"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Test-Driven Development (TDD)
@@ -3,7 +3,7 @@ name: verify
3
3
  description: "Requires fresh verification evidence before claiming work is complete, fixed, passing, review-ready, or ready to commit. Not for speculative confidence or stale results."
4
4
  when_to_use: "verify, completion claim, fixed claim, tests pass, review-ready, commit, fresh evidence, 验证, 完成前检查"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Verification Before Completion
@@ -3,7 +3,7 @@ name: clarify
3
3
  description: "Grills ambiguous loopx work until material questions are answered, then routes to spec or plan using a design gate. Not for clear implementation tasks, approved specs, or code changes."
4
4
  when_to_use: "clarify, requirements, ambiguous request, unclear scope, non-goals, decision boundaries, acceptance criteria, 需求澄清, 范围不清"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # loopx Clarify
@@ -12,6 +12,17 @@ Do not accept vague answers. Do not optimize for speed. The goal is shared under
12
12
 
13
13
  ## Core Loop
14
14
 
15
+ ## Repo Specs And Memory Context
16
+
17
+ Before using this skill in a repository, inspect loopx long-lived context when it exists:
18
+
19
+ - If `docs/loopx/specs/` exists, inspect the directory names and filenames. If `docs/loopx/specs/index.md` exists, use it as a map, but do not require it. Read only specs relevant to the requested domain, affected files, workflow behavior, or named source document.
20
+ - If `.loopx/memory/MEMORY.md` exists, read it as curated project memory before deciding what is already known.
21
+ - If `.loopx/memory/index.jsonl` exists, use it only as a retrieval index for relevant active memory cards; do not treat it as an append-only log.
22
+ - Treat current user instructions and the named source document as highest priority, `docs/loopx/specs/` as binding long-lived repo rules, and `.loopx/memory/` as advisory context. Memory is advisory and must not override current task instructions, approved source docs, or repo specs.
23
+
24
+ Do not read every file under `docs/loopx/specs/` by default. Prefer relevant specs selected by filename, title, frontmatter such as `applies_to`, or the files/domains involved in the task.
25
+
15
26
  Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
16
27
 
17
28
  Ask the questions one at a time.
@@ -3,7 +3,7 @@ name: debug
3
3
  description: "Finds root cause for bugs, failing tests, build failures, regressions, and unexpected behavior before fixes. Not for new feature planning or routine code review."
4
4
  when_to_use: "debug, bug, test failure, build failure, regression, unexpected behavior, root cause, 报错, 失败, 回归, 排查"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Systematic Debugging
@@ -3,7 +3,7 @@ name: doc-readability
3
3
  description: "Use when evaluating, rewriting, or editing documents for human readability, unclear viewpoints, AI-like prose, bloated specs, PRDs, requirements docs, meeting notes, strategy docs, or internal knowledge-base articles. Not for code review, implementation planning, or file-format conversion."
4
4
  when_to_use: "document readability, PRD assessment, requirements gaps, AI-like prose, unclear viewpoint, rewrite docs, editing docs, 文档可读性, 去AI味, 需求文档评估"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Doc Readability
@@ -3,7 +3,7 @@ name: exec
3
3
  description: "Executes a written loopx implementation plan sequentially with review checkpoints. Not for unclear plans, missing requirements, or subagent-first execution."
4
4
  when_to_use: "written implementation plan, inline execution, sequential plan execution, review checkpoints, no subagent lane"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Exec
@@ -3,7 +3,7 @@ name: final-review
3
3
  description: "Performs whole-feature review after implementation and staged task review. Not for per-task review, unresolved scope, implementation, or pure documentation polish."
4
4
  when_to_use: "final-review, final code review, whole feature review, integration review, pre-finish review, after subagent-exec, runtime risk review, 最终评审"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Final Review
@@ -3,7 +3,7 @@ name: finish
3
3
  description: "Finishes completed loopx development work after tests pass by presenting merge, PR, keep, or discard options. Not for unfinished work or failing verification."
4
4
  when_to_use: "implementation complete, tests pass, finish branch, create pull request, merge locally, keep branch, discard work"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Finish
@@ -3,7 +3,7 @@ name: fix-review
3
3
  description: "Handles received code review feedback with verification, technical evaluation, pushback, and one-item-at-a-time fixes. Not for requesting a new review or implementing unrelated changes."
4
4
  when_to_use: "fix-review, received code review feedback, review comments, reviewer suggestions, requested changes, 处理评审意见"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Fix Review
@@ -3,7 +3,7 @@ name: go-style
3
3
  description: "Applies loopx Go coding style for .go edits, tests, errors, context, naming, and interface boundaries. Not for non-Go code or Kratos-specific architecture by itself."
4
4
  when_to_use: "go-style, Go, golang, .go files, go tests, gofmt, idiomatic Go, Go style, Go 代码"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Go Style
@@ -3,7 +3,7 @@ name: kratos
3
3
  description: "Supports Go-Kratos microservices, proto/buf APIs, service/biz/data layers, middleware, auth, config, and troubleshooting. Not for generic Go style alone."
4
4
  when_to_use: "kratos, Go-Kratos, proto, buf, service layer, biz layer, data layer, middleware, auth, config, Kratos 微服务"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Kratos
@@ -3,7 +3,7 @@ name: plan-to-exec
3
3
  description: "Creates bite-sized implementation plans from approved requirements, clarify output, or design specs with exact files, tests, commands, expected output, and execution handoff. Not for unresolved requirements, design decisions, PRD generation, or code changes."
4
4
  when_to_use: "plan-to-exec, plan, implementation plan, execution plan, task breakdown, approved requirements, approved design spec, docs/loopx/design, 实施计划, 执行计划, 任务拆分"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  argument-hint: "<design spec path or feature name>"
8
8
  ---
9
9
 
@@ -21,6 +21,17 @@ Use this skill after requirements are clear. The source may be:
21
21
  - `.loopx/intake/clarify-<slug>-<timestamp>.md`
22
22
  - an issue, PRD, or requirements document that already fixes material decisions
23
23
 
24
+ ## Repo Specs And Memory Context
25
+
26
+ Before using this skill in a repository, inspect loopx long-lived context when it exists:
27
+
28
+ - If `docs/loopx/specs/` exists, inspect the directory names and filenames. If `docs/loopx/specs/index.md` exists, use it as a map, but do not require it. Read only specs relevant to the requested domain, affected files, workflow behavior, or named source document.
29
+ - If `.loopx/memory/MEMORY.md` exists, read it as curated project memory before deciding what is already known.
30
+ - If `.loopx/memory/index.jsonl` exists, use it only as a retrieval index for relevant active memory cards; do not treat it as an append-only log.
31
+ - Treat current user instructions and the named source document as highest priority, `docs/loopx/specs/` as binding long-lived repo rules, and `.loopx/memory/` as advisory context. Memory is advisory and must not override current task instructions, approved source docs, or repo specs.
32
+
33
+ Do not read every file under `docs/loopx/specs/` by default. Prefer relevant specs selected by filename, title, frontmatter such as `applies_to`, or the files/domains involved in the task.
34
+
24
35
  Do not re-decide product or architecture. If the source is incomplete, contradictory, or missing product behavior, API, data, state, permission, migration, compatibility, or architecture decisions, return to `clarify` or `spec` instead of filling those gaps inside `plan`.
25
36
 
26
37
  **Announce at start:** "I'm using the plan-to-exec skill to create the implementation plan."
@@ -3,7 +3,7 @@ name: refactor-plan
3
3
  description: "Creates a behavior-preserving refactor plan with user interview, repo evidence, tiny commits, scope boundaries, and testing decisions. Not for feature changes or immediate implementation."
4
4
  when_to_use: "refactor-plan, refactor request, refactoring RFC, tiny commits, behavior-preserving cleanup, architecture cleanup, 重构计划"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  This skill will be invoked when the user wants to create a refactor request. You should go through the steps below. You may skip steps if you don't consider them necessary.
@@ -3,7 +3,7 @@ name: review
3
3
  description: "Dispatches a loopx code reviewer subagent against a concrete git range and requirements. Not for implementation, planning, or unresolved review scope."
4
4
  when_to_use: "request code review, completed task review, major feature review, pre-merge review, subagent code quality check"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Review
@@ -3,7 +3,7 @@ name: spec
3
3
  description: "Writes software design specs from already-clarified requirements, including solution approach, architecture outline, detailed design, tradeoffs, verification design, and handoff context. Not for unresolved requirements, PRD generation, implementation task planning, or code changes."
4
4
  when_to_use: "spec, design spec, technical design, design proposal, detailed design, architecture design, 设计方案, 概要设计, 详细设计, 技术方案"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # loopx Spec
@@ -12,6 +12,17 @@ Turn clarified requirements into design documents. Do not invent missing require
12
12
 
13
13
  ## Inputs
14
14
 
15
+ ## Repo Specs And Memory Context
16
+
17
+ Before using this skill in a repository, inspect loopx long-lived context when it exists:
18
+
19
+ - If `docs/loopx/specs/` exists, inspect the directory names and filenames. If `docs/loopx/specs/index.md` exists, use it as a map, but do not require it. Read only specs relevant to the requested domain, affected files, workflow behavior, or named source document.
20
+ - If `.loopx/memory/MEMORY.md` exists, read it as curated project memory before deciding what is already known.
21
+ - If `.loopx/memory/index.jsonl` exists, use it only as a retrieval index for relevant active memory cards; do not treat it as an append-only log.
22
+ - Treat current user instructions and the named source document as highest priority, `docs/loopx/specs/` as binding long-lived repo rules, and `.loopx/memory/` as advisory context. Memory is advisory and must not override current task instructions, approved source docs, or repo specs.
23
+
24
+ Do not read every file under `docs/loopx/specs/` by default. Prefer relevant specs selected by filename, title, frontmatter such as `applies_to`, or the files/domains involved in the task.
25
+
15
26
  Use the user's PRD, external requirements document, or approved `clarify` output as the source of truth.
16
27
 
17
28
  Before writing, inspect relevant code and docs when the task touches an existing system. If a design question can be answered from the repo, answer it from evidence. If a material requirement, constraint, owner decision, or product behavior is still unclear, stop and route back to `clarify`.
@@ -3,7 +3,7 @@ name: subagent-exec
3
3
  description: "Executes approved loopx implementation plans with fresh subagents per independent task and staged review. Not for planning, unclear requirements, or tightly coupled edits."
4
4
  when_to_use: "approved implementation plan, independent tasks, subagent execution, staged spec review, code quality review, parallel-capable execution"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Subagent Exec
@@ -3,7 +3,7 @@ name: tdd
3
3
  description: "Guides feature and bugfix implementation through a failing test before production code and red-green-refactor discipline. Not for generated files or throwaway prototypes."
4
4
  when_to_use: "tdd, failing test first, feature implementation, bugfix, regression test, red green refactor, 测试先行"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Test-Driven Development (TDD)
@@ -3,7 +3,7 @@ name: verify
3
3
  description: "Requires fresh verification evidence before claiming work is complete, fixed, passing, review-ready, or ready to commit. Not for speculative confidence or stale results."
4
4
  when_to_use: "verify, completion claim, fixed claim, tests pass, review-ready, commit, fresh evidence, 验证, 完成前检查"
5
5
  metadata:
6
- version: "0.2.8"
6
+ version: "0.2.9"
7
7
  ---
8
8
 
9
9
  # Verification Before Completion
package/src/cli.mjs CHANGED
@@ -30,7 +30,7 @@ function usage() {
30
30
  ' loopx status [slug] [--json]',
31
31
  ' loopx next <slug> [--json]',
32
32
  ' loopx setup-context',
33
- ' loopx install-skills [--target <codex|claude|all>] [--project] [--mode <copy|symlink>] [--dir <path>] [--yes] [--dry-run] [--json]',
33
+ ' loopx install-skills [--target <codex|claude|all>] [--project] [--mode <copy|symlink>] [--dir <path>] [--add-agent-guidance] [--yes] [--dry-run] [--json]',
34
34
  ' loopx doctor [--json]',
35
35
  ' loopx migrate',
36
36
  ' loopx repair-install',
@@ -60,6 +60,7 @@ async function promptInstallOptions() {
60
60
  const targetAnswer = (await rl.question('Install targets (codex, claude, all) [all]: ')).trim().toLowerCase();
61
61
  const projectAnswer = (await rl.question('Install Claude project skills instead of user skills? [y/N]: ')).trim().toLowerCase();
62
62
  const modeAnswer = (await rl.question('Install mode (copy, symlink) [copy]: ')).trim().toLowerCase();
63
+ const guidanceAnswer = (await rl.question('Add loopx guidance to Codex AGENTS.md / Claude CLAUDE.md? [y/N]: ')).trim().toLowerCase();
63
64
  const proceedAnswer = (await rl.question('Proceed? [y/N]: ')).trim().toLowerCase();
64
65
  if (proceedAnswer !== 'y' && proceedAnswer !== 'yes') {
65
66
  return null;
@@ -69,6 +70,7 @@ async function promptInstallOptions() {
69
70
  targets: target === 'all' ? ['codex', 'claude'] : [target],
70
71
  project: projectAnswer === 'y' || projectAnswer === 'yes',
71
72
  installMethod: modeAnswer === 'symlink' ? 'symlink' : 'copy',
73
+ agentGuidance: guidanceAnswer === 'y' || guidanceAnswer === 'yes',
72
74
  };
73
75
  } finally {
74
76
  rl.close();
@@ -83,6 +85,7 @@ function installOptionsFromArgs(options) {
83
85
  project: Boolean(options.get('--project')),
84
86
  installMethod: options.get('--mode') === 'symlink' ? 'symlink' : 'copy',
85
87
  dir: options.get('--dir'),
88
+ agentGuidance: Boolean(options.get('--add-agent-guidance') || options.get('--add-codex-agents-guidance')),
86
89
  };
87
90
  }
88
91
 
@@ -2,6 +2,7 @@ import { existsSync } from 'node:fs';
2
2
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
3
3
  import { dirname, join, relative, resolve } from 'node:path';
4
4
 
5
+ import { discoverLoopxContextArtifacts } from './loopx-context-artifacts.mjs';
5
6
  import { inspectWorkspaceContext, resolveWorkspaceContextPaths } from './workspace-context.mjs';
6
7
 
7
8
  export const CONTEXT_MANIFEST_SCHEMA_VERSION = 1;
@@ -64,6 +65,53 @@ function stableRows(rows) {
64
65
  .slice(0, MAX_MANIFEST_ROWS);
65
66
  }
66
67
 
68
+ async function loopxRepoContextRows(cwd, stage, priorityStart) {
69
+ const artifacts = await discoverLoopxContextArtifacts(cwd);
70
+ const rows = [];
71
+ let priority = priorityStart;
72
+ if (artifacts.specsRoot) {
73
+ rows.push(row(cwd, {
74
+ stage,
75
+ kind: 'repo-specs',
76
+ path: artifacts.specsRoot,
77
+ reason: 'long_lived_loopx_specs_directory',
78
+ priority: priority++,
79
+ required: false,
80
+ }));
81
+ }
82
+ for (const spec of artifacts.specFiles) {
83
+ rows.push(row(cwd, {
84
+ stage,
85
+ kind: 'repo-spec',
86
+ path: spec.path,
87
+ reason: 'long_lived_loopx_spec',
88
+ priority: priority++,
89
+ required: false,
90
+ }));
91
+ }
92
+ if (artifacts.memorySummary) {
93
+ rows.push(row(cwd, {
94
+ stage,
95
+ kind: 'memory-summary',
96
+ path: artifacts.memorySummary.path,
97
+ reason: 'curated_loopx_project_memory',
98
+ priority: priority++,
99
+ required: false,
100
+ }));
101
+ }
102
+ if (artifacts.memoryIndex) {
103
+ rows.push(row(cwd, {
104
+ stage,
105
+ kind: 'memory-index',
106
+ path: artifacts.memoryIndex.path,
107
+ reason: 'curated_loopx_memory_retrieval_index',
108
+ priority: priority++,
109
+ required: false,
110
+ }));
111
+ }
112
+ return rows;
113
+ }
114
+
67
115
  export async function writeContextManifest(path, rows) {
68
116
  const text = stableRows(rows).map((item) => JSON.stringify(item)).join('\n');
69
117
  await mkdir(dirname(path), { recursive: true });
@@ -141,6 +189,7 @@ export async function generateBuildContextManifest({ cwd, root, state, slug }) {
141
189
  row(cwd, { stage: 'build', kind: 'domain-context', path: contextPaths.domainGlossary, reason: 'domain_vocabulary', priority: 34, required: contextSetup.status !== 'missing' }),
142
190
  row(cwd, { stage: 'build', kind: 'agent-domain', path: contextPaths.agentDomain, reason: 'agent_context_rules', priority: 35, required: false }),
143
191
  row(cwd, { stage: 'build', kind: 'workspace-config', path: join(cwd, '.loopx', 'config.json'), reason: 'project_rules_spec_sources_and_verification_commands', priority: 36, required: false }),
192
+ ...await loopxRepoContextRows(cwd, 'build', 37),
144
193
  ];
145
194
  const manifestPath = buildContextManifestPath(root);
146
195
  await writeContextManifest(manifestPath, rows);
@@ -163,7 +212,8 @@ export async function generateReviewContextManifest({ cwd, root, state, slug })
163
212
  row(cwd, { stage: 'review', kind: 'build-support', path: join(root, 'build-support'), reason: 'build_gate_evidence', priority: 30, required: false }),
164
213
  row(cwd, { stage: 'review', kind: 'agent-domain', path: contextPaths.agentDomain, reason: 'agent_context_rules', priority: 31, required: false }),
165
214
  row(cwd, { stage: 'review', kind: 'workspace-config', path: join(cwd, '.loopx', 'config.json'), reason: 'project_rules_spec_sources_and_verification_commands', priority: 32, required: false }),
166
- row(cwd, { stage: 'review', kind: 'state', path: join(root, 'state.json'), reason: 'workflow_state', priority: 40 }),
215
+ ...await loopxRepoContextRows(cwd, 'review', 33),
216
+ row(cwd, { stage: 'review', kind: 'state', path: join(root, 'state.json'), reason: 'workflow_state', priority: 60 }),
167
217
  ];
168
218
  const manifestPath = reviewContextManifestPath(root);
169
219
  await writeContextManifest(manifestPath, rows);