Types are: default, force_default, normal, override, force_override, automatic. Ok.
And locations from which they may come in are: Nodes, Attribute files, Recipes, Environments, Roles.
I confused how in name attribute these values should be reflected and SHOULD?
Can i name attribute just [my_attribute] or i need specify type default[my_attribute] or if i not specify type some of types will be set by default?
Or i should specify location in name of attribute from where it come? Like: recipe[my_attribute]?
Also i see in documentation attribute: node['platform']node not belong to types nor locations?
In generally which name should be passed before sq. brackets  in attribute name? I thought it should be type like default, normal, etc. But node confused me it is not type nor source.
The type refer to attribute precedence. It is basically about which attribute declaration wins on the same attribute. The locations are the different places where attribute declaration can happen. There is a table that provides a good summary about these two topics(the highest number wins from a precedence point of view): https://docs.chef.io/attributes.html#attribute-precedence
From the attributes that you create (and from other sources like ohai) the node object gets created. In recipes you can refer to the attribute through the node object: node['my_cookbook']['my_attribute']
The following patterns should be followed:
try to use default type only
if your cokbook’s name is my_cookbook then your cookbooks’s attributes should be under that namespace default['my_cookbook']['my_attribute']
In my previous comment I have said that the node['my_cookbook']['my_attribute'] syntax is used when you want to refer to the attribute in a recipe. Since you can declare attributes in recipes, but through the node object, you have to use a different syntax: node.default['my_cookbook']['my_attribute']
The ['my_cookbook']['my_attribute'] is causing syntax error. You must specify a type when declaring an attribute and when you refer to an attribute you have call the node object
The point of the attribute precedence system is to allow you (or an upstream cookbook author) to set sensible defaults for data that the end-user can override as needed. For example, a generic cookbook for a web server might configure the server listen on port 8000 so it doesn't need root, but you could set it to port 80 for a production scenario.
Whenever you set a value for an attribute, you are required to do something to specify the precedence level you want to write to, because Chef can't guess this on your behalf. 99% of the time, when you read the value, you want the highest precedence one.
Basically yes. You can read from specific values but there's almost never a reason you'd want to.
There's a wrinkle here that, in an attributes file, the node part is implicit (you can still use it if you want, but it's not idiomatic). In a recipe, the syntax you've given is correct. But note that mostly you want to set default level values. Also, Ruby doesn't allow hyphens in method names, the correct name is force_default.