<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_manifold_attribute(cls, name):
 """ Register a manifold engine attribute. @return: field definition object, or None if "name" isn't a manifold attribute. """

        if name.startswith("custom_"):
            try:
                return FieldDefinition.FIELDS[name]
            except KeyError:
                field = OnDemandField(fmt.to_unicode, name, "custom attribute %r" % name.split('_', 1)[1],
                    matcher=matching.PatternFilter)
                setattr(cls, name, field) # add field to all proxy objects

                return field
        elif name.startswith("kind_") and name[5:].isdigit():
            try:
                return FieldDefinition.FIELDS[name]
            except KeyError:
                limit = int(name[5:].lstrip('0') or '0', 10)
                if limit > 100:
                    raise error.UserError("kind_N: N > 100 in %r" % name)
                field = OnDemandField(set, name,
                    "kinds of files that make up more than %d%% of this item's size" % limit,
                    matcher=matching.TaggedAsFilter, formatter=_fmt_tags,
                    engine_name="kind_%d" % limit)
                setattr(cls, name, field)

                return field