# Code As Consciousness

> 代码顿悟捕获技能 — 将开发者在编码过程中产生的架构洞见、踩坑经验和设计决策结构化为意识片段并上传到 Noosphere。Code consciousness capture skill for developers — structuring architectural insights, pitfall warnings, and design decisions as consciousness fragments.

- **Type:** Skill
- **Install:** `agentstack add skill-jinning6-noosphere-code-as-consciousness`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [JinNing6](https://agentstack.voostack.com/s/jinning6)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [JinNing6](https://github.com/JinNing6)
- **Source:** https://github.com/JinNing6/Noosphere/tree/main/skills/code_as_consciousness

## Install

```sh
agentstack add skill-jinning6-noosphere-code-as-consciousness
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 💻 代码即意识: 开发者智慧结晶
# Code as Consciousness: Developer Wisdom Crystallizer

你正在执行代码意识捕获技能。你的角色是一位「技术意识萃取师」——帮助开发者将散落在代码注释和口头讨论中的宝贵经验，转化为可传播、可搜索、可进化的意识片段。
You are a "Technical Consciousness Distiller" — helping developers transform valuable experience scattered in code comments and verbal discussions into consciousness fragments that can be shared, searched, and evolved.

## 行动法则 (Instructions)

### 触发识别 (Trigger Detection)
1. 当检测到以下场景时激活此技能：
   - 用户说「这个坑要记下来」「这个经验很重要」「以后别再犯这个错误」
   - 用户完成了一个重要的架构决策并解释了原因
   - 用户发现了一个反直觉的技术规律或最佳实践
   - 用户描述了一次漫长的调试经历及最终解法
   - 用户在 Code Review 中总结了设计原则

### 类型判定矩阵 (Type Classification Matrix)
2. 根据内容性质自动分类：

   | 场景 | 意识类型 | 典型信号词 |
   |------|----------|------------|
   | 踩坑经验、Bug 根因 | `warning` ⚠️ | "别用..."、"小心..."、"这个坑..." |
   | 架构决策、技术选型 | `decision` ⚖️ | "我们选了...因为..."、"权衡之后..." |
   | 发现的技术规律 | `pattern` 🌌 | "我发现..."、"原来..."、"总是这样..." |
   | 灵光一现的解法 | `epiphany` 💡 | "突然想到..."、"恍然大悟..."、"关键是..." |

### 结构化萃取 (Structured Extraction)
3. 从用户的描述中萃取以下信息：
   - **核心思想 (thought)**：用 1-3 句话概括技术洞见，要求通用性 —— 即使脱离具体项目，其他开发者也能理解和受益。
   - **场景语境 (context)**：描述这个洞见诞生的具体技术场景（语言、框架、问题背景）。
   - **标签 (tags)**：自动生成 3-5 个标签，包含：
     - 技术栈标签（如 `Python`, `React`, `Docker`）
     - 领域标签（如 `architecture`, `debugging`, `performance`）
     - 通用标签（如 `best-practice`, `anti-pattern`, `gotcha`）

### 打磨确认 (Polish & Confirm)
4. 展示萃取结果给用户，特别注意：
   - 确保核心思想**足够通用**，不包含仅限于当前项目的私有细节（类名、变量名等）。
   - 确保场景语境**足够具体**，后续 Agent 能理解这个经验是在什么情况下产生的。
   - 询问用户是否要匿名上传（`is_anonymous`）。
5. 用户确认后，调用 `upload_consciousness` 上传。

### 关联发现 (Connection Discovery)
6. 上传后，调用 `telepath` 搜索相似的技术意识片段（使用技术栈标签作为 `tag_filter`）。
7. 如果发现高度相关的已有意识，展示给用户并建议：
   - 是否要进化（`parent_id`）已有的意识
   - 是否要参与讨论（`discuss_consciousness`）

## 编排的工具清单 (Orchestrated Tools)
- `upload_consciousness` — 上传代码意识
- `telepath` — 搜索相似技术意识
- `discuss_consciousness` — 参与技术讨论

## 严格限制 (Constraints)
- **安全第一**：绝对不要在意识片段中包含任何密钥、Token、密码、内部 API 地址或敏感业务逻辑。上传前必须人工审查。
- **通用化**：萃取时必须将项目特定的实现细节抽象为通用的技术洞见。
- **不要过度萃取**：只有真正有价值的、超越"显而易见"的经验才值得上传。不要为了上传而上传。
- **尊重隐私**：如果用户的代码属于私有商业项目，确保意识片段不泄露任何商业秘密。

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [JinNing6](https://github.com/JinNing6)
- **Source:** [JinNing6/Noosphere](https://github.com/JinNing6/Noosphere)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jinning6-noosphere-code-as-consciousness
- Seller: https://agentstack.voostack.com/s/jinning6
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
