# How Boundary Conditions (B Field) Prevent Skill Misuse in Cangjie-Skill

> Learn how cangjie-skill's B field boundary conditions prevent skill misuse by filtering inappropriate contexts before execution, ensuring reliable and accurate skill application.

- Repository: [kangarooking/cangjie-skill](https://github.com/kangarooking/cangjie-skill)
- Tags: internals
- Published: 2026-08-13

---

**The B (Boundary) field in cangjie-skill explicitly defines when a skill should not be applied, filtering out inappropriate contexts before execution to prevent "random calls" and maintain reliability.**

The cangjie-skill repository implements a structured methodology for distilling knowledge into reusable AI skills. Each skill follows the **R-I-A1-A2-E-B** format, where the **B (Boundary)** segment serves as a critical guardrail against misuse. By documenting explicit non-applicability conditions and author blind-spots, the boundary conditions ensure that skills are only invoked in appropriate contexts, eliminating the risk of over-generalized or erroneous outputs.

## Understanding the B (Boundary) Field Structure

The cangjie-skill framework organizes every distilled skill into six distinct sections: **R** (Role), **I** (Input), **A1** (Analysis 1), **A2** (Analysis 2), **E** (Execution), and **B** (Boundary). This structure ensures comprehensive coverage of both applicability and limitations.

### The Six-Section Skill Architecture

In [`methodology/04-stage2-ria-plus.md`](https://github.com/kangarooking/cangjie-skill/blob/main/methodology/04-stage2-ria-plus.md), the framework defines the B segment as the repository for *when the skill should NOT be applied* and any *blind-spots* identified during the original source's critique phase. Without this section, a skill lacks the necessary constraints to prevent inappropriate invocation.

The methodology explicitly warns that missing boundary conditions lead to skill overuse: "没边界的 skill 会被过度调用,最终用户失望" (skills without boundaries will be over-called, ultimately disappointing users) [【methodology/04-stage2-ria-plus.md#L89】](https://github.com/kangarooking/cangjie-skill/blob/main/methodology/04-stage2-ria-plus.md#L89).

## How Boundaries Are Derived from Source Analysis

Boundary conditions do not emerge arbitrarily; they are systematically extracted from the source material's critique phase and counter-example analysis.

### Extracting Counter-Examples

According to [`extractors/counter-example-extractor.md`](https://github.com/kangarooking/cangjie-skill/blob/main/extractors/counter-example-extractor.md), counter-examples are essential for establishing valid boundaries. The documentation states: "没有反例,skill 就没有边界,会在不该用的时候被调用,反而帮倒忙" (without counter-examples, skills have no boundaries and will be called when they shouldn't be, causing more harm than good) [【extractors/counter-example-extractor.md#L7】](https://github.com/kangarooking/cangjie-skill/blob/main/extractors/counter-example-extractor.md#L7).

These counter-examples feed directly into the B field, creating explicit exclusion criteria based on real limitations discovered during the distillation process.

### The BOOK_OVERVIEW Critique Phase

The initial critique phase (Stage 0) generates the **BOOK_OVERVIEW**, which identifies author blind-spots and contextual limitations. These findings are preserved in the B section to prevent the AI from generalizing beyond the source material's valid domain.

## Preventing Skill Misuse at Runtime

The B field operates as an active filter during skill selection, not merely passive documentation.

### The Applicability Check Logic

When an AI agent receives a request, it evaluates candidate skills against their Boundary conditions before execution. The following pseudo-logic illustrates this guardrail mechanism:

```python
def is_skill_applicable(skill, request):
    # Iterate through B field conditions

    for condition in skill.boundary.not_applicable:
        if condition.matches(request):
            return False  # B field blocks misuse

    return True

```

This check occurs immediately before the **E** (Execution) steps run. If the request matches any "not-applicable" condition listed in the B section, the skill is filtered out, ensuring only context-appropriate knowledge surfaces.

### Explicit Non-Applicability Documentation

A typical B section in [`SKILL.md`](https://github.com/kangarooking/cangjie-skill/blob/main/SKILL.md) explicitly lists exclusion scenarios:

```markdown

## B (Boundary)

- **不适用场景**：当用户询问关于"实时股价"而不是"投资原则"时，本 skill 不应被调用。
- **盲点**：原作者在书中未讨论新兴的加密资产，故本 skill 不覆盖此类资产的评估。

```

This concrete definition prevents the "random calls" (防止乱调用) highlighted in the methodology [【methodology/04-stage2-ria-plus.md#L68】](https://github.com/kangarooking/cangjie-skill/blob/main/methodology/04-stage2-ria-plus.md#L68).

## Enforcing Boundaries Through Templates

The `templates/SKILL.md.template` and the generated [`SKILL.md`](https://github.com/kangarooking/cangjie-skill/blob/main/SKILL.md) files enforce boundary documentation through structural requirements. Line 119 of the standard skill template includes a dedicated **B (Boundary)** bullet prompting authors to list "什么时候不适用 / 来自阶段 0 批判阶段的作者盲点" (when not to apply / author blind-spots from stage 0 critique) [【SKILL.md#L119】](https://github.com/kangarooking/cangjie-skill/blob/main/SKILL.md#L119).

This template-driven approach ensures that no skill enters the repository without explicit boundary definitions, institutionalizing the guardrail against misuse.

## Summary

- The **B (Boundary)** field in cangjie-skill explicitly records when skills should not be applied and identifies author blind-spots from the critique phase.
- Boundary conditions are derived from **counter-examples** and the **BOOK_OVERVIEW** critique, ensuring they reflect actual limitations rather than arbitrary restrictions.
- The methodology warns that skills without boundaries risk being over-called, leading to user disappointment and erroneous outputs.
- Runtime applicability checks filter skills based on B field conditions before executing **E** (Execution) steps, preventing inappropriate invocations.
- The [`SKILL.md`](https://github.com/kangarooking/cangjie-skill/blob/main/SKILL.md) template enforces boundary documentation, ensuring every skill includes explicit non-applicability scenarios.

## Frequently Asked Questions

### What happens if a skill lacks a B (Boundary) section?

According to the cangjie-skill methodology in [`methodology/04-stage2-ria-plus.md`](https://github.com/kangarooking/cangjie-skill/blob/main/methodology/04-stage2-ria-plus.md), skills without boundaries will be "over-called" (过度调用), resulting in disappointed users. Without explicit non-applicability conditions, the AI agent cannot filter out inappropriate contexts, leading to random invocations that apply knowledge outside its valid domain.

### How are boundary conditions different from input validation?

While input validation checks format and syntax, the **B field** evaluates semantic and contextual applicability. It answers whether the skill's knowledge applies to the user's specific scenario based on blind-spots and limitations identified during source analysis, not merely whether the input structure is correct.

### Where does the content for the B field originate?

Boundary content comes from two primary sources documented in the repository: **counter-examples** collected during Stage 2 (as noted in [`extractors/counter-example-extractor.md`](https://github.com/kangarooking/cangjie-skill/blob/main/extractors/counter-example-extractor.md)) and the **BOOK_OVERVIEW** critique from Stage 0. These sources identify when the original author's advice does not apply or where their knowledge has gaps.

### Can boundary conditions be updated after initial skill creation?

Yes, the methodology implies that as new counter-examples emerge or additional blind-spots are identified, the B section in [`SKILL.md`](https://github.com/kangarooking/cangjie-skill/blob/main/SKILL.md) should be updated to reflect these limitations. This iterative refinement ensures the skill guardrails remain accurate as contexts evolve.